Parameter format for "delim[,filler]" have changed comparing to previous version. Please update your scripts is special delimiter was used in your call.
DESCRIPTION
------------
Align is a XFCN allowing to align in columns the content of a field.
F = "<col. width>[,<L[eft]|R[ight]|C[enter]|D[ecimal]>[,<separator>]]"
PARAMETERS
------------
<text> can be any valid HyperTalk container, or a litteral string.
[,<F1>[…,<Fn>]] define formats, each format applying to the corresponding column. Up to 14 formats can be defined, the last one being used for all succeeding columns.
A format is a three items string : an integer for the column width (>0 and
<256), a char (L, R, C or D) for the alignment of the text in the column and a separation string of any length which will be inserted after the column.
If the char "*" is used for the column width, it will be calculated accor-ding to the longest item found in it.
If no format is passed as param, "*,L, " will be used as default.
"s=<sep char>" is an optionnal single character, and allows to use any other char in place of comma to delimit the columns.
"f=<filler char>" is an optionnal single character, and allows to define the filler character (space by default).
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The XFCN return the columnized text. If a chunk is longer than its column width, its last (or first, with right alignment) char will be "…".
Each column's width cannot exceed 255 chars.
Finally, use a non-proportional font (Courier, Monaco, etc.) for the field to get a correct presentation.
If an error occurs, the fonction will return :
"Error : Out of memory"
"Error : Missing parameter"
"Error : Param must be "s=…" or "f=…""
"Error : Missing char following "X=""
"Error : First item of Format X must be an integer > 0"
"Error : First item of Format X must be an integer Γëñ 255"
"Error : Second item of Format X must be [l,r,c,d]"
VERSIONS HISTORY
-----------------
2.6 : 06/09/92
ΓÇó Fixed bug when no format param is passed
ΓÇó Fixed bug with decimal format and non-decimal data
2.5 : 03/17/92
ΓÇó Fixed decimal alignment
ΓÇó Trailing returns removed from input List
2.4 : 03/15/92
ΓÇó Fixed that rare, random & nasty bug
ΓÇó Unlimited columns number
ΓÇó Added decimal alignment
ΓÇó Changed delim & filler params format
ΓÇó Only first param is now needed
ΓÇó Each line is extended to the last column.
2.2 :
ΓÇó Max columns extended to 100 with range checking
2.1 :
ΓÇó Last column delimiter removed.
2.0 :
ΓÇó Fixed a small bug arising with certain delimiter chars.
ΓÇó Added the automatic column width calculation.
1.1 :
ΓÇó third items of a format string can now be empty
ΓÇó no more separator string returned after last column
ΓÇó all separator strings are shown, even for empty lines
ΓÇó filler char choice added
ΓÇó all separator strings shown, whatever is number of items of line
ΓÇó trailing spaces removed at the end of the lines
</text>
</content>
<content>
<layer>card</layer>
<id>9</id>
<text>hello,this,is,an,interresting,test,2.1
hello,this,is,an,interresting,test,.256
hello,this,is,an,interresting,test,66
hello,this,,an,interresting,test,(56)
hello,this,is,an,interresting,test,-17.22
hello,this,is,an,,test,(72.1)</text>
</content>
<content>
<layer>card</layer>
<id>15</id>
<text>put Align(cd fld 3,"10,Left,|","10,c,|","6,R,|","10,L,|","6,L,|","*,r, |$","*,D,|") into cd fld 4</text>
</content>
<content>
<layer>card</layer>
<id>8</id>
<text>
Command string to execute : (click on Align button)</text>
</content>
<name></name>
<script></script>
</card>
card_4934.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
Clicking on left and right arrows allows to display previous or next month. Holding Optionkey down allows to jump from year to year.
Clicking on a day of month displays the week and day numbers at the bottom of the window.
Clicking on the month's name brings back to current month.
Macintosh's internal clock can only handle dates between 1/1/1904 and 2/6/2040.
</span><span class="style4">MESSAGES
</span><span class="style1">
</span><span class="style3">OpenCalendoid</span><span class="style1"> : sent when a windoid is opened, followed by the windoid name and ID. This allows to define window properties before it is shown, since the message can be trapped using a handler :
</span><span class="style5"> on openCalendoid WName,WId
if WName is "MyWindow" then...
end openCalendoid
</span><span class="style1"> </span><span class="style3">CloseCalendoid</span><span class="style1"> : sent when a windoid is closed, followed by the windoid name and ID. This allows to define window properties before it is shown, since the message can be trapped using a handler :
</span><span class="style5"> on closeCalendoid WName,WId
if WName is "MyWindow" then...
end closeCalendoid
</span><span class="style3">
</span><span class="style1"> </span><span class="style3">ClickInCalendoid</span><span class="style1"> : </span><span class="style5">s</span><span class="style1">ent when double-clicking on a day in the window, followed by the windoid name and ID, the clicked date in short format, the week and day numbers.
</span><span class="style5"> on clickInCalendoid WName,WId,When,WeekNb,DayNb
ChooseColor allows to choose a color using the Apple Color Picker dialog.
SYNTAX
-------
ChooseColor([<prompt>[,<initial color>]])
PARAMETERS
------------
All parameters are optional.
Prompt is a string that will be prompted in the Color Picker dialog. Default value is "Please select a color :".
Initial color is a three integer items string corresponding to red, green and blue values of the color that will be shown at the dialog's opening.
Using "!" and "?" as parameter will return an online help (resp. copyright and syntax).
USING
------
The XFCN retuns a three integer items string corresponding to red, green and blue values of the choosen color. If cancelled, the returned string is empty.
If an error occurs, the XFCN can return :
"Error : Bad red value"
"Error : Bad green value"
"Error : Bad blue value"
HISTORY
--------
1.1
ΓÇó Use notification manager for HC 2.0
</text>
</content>
<name>ChooseColor 1.1</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_6407.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
ask "Device name :" with first item of DeviceList(Driver)
if it is empty then exit mouseUp
put it into Device
set cursor to watch
ChoosePrinter Driver,Device
get the Result
if it Γëá empty
then answer it
else answer "Current device :" && item 2 of CurrPrinter()
end mouseUp
</script>
</part>
<content>
<layer>card</layer>
<id>1</id>
<text>
Chooser 1.3
by Frédéric RINALDI
DESCRIPTION
------------
This stack contains 2 XFCN and 1 XCMD which allow to act like with the chooser, thus select any printing driver.
IMPORTANT
This kind of stuff is strictly forbidden by the Human Interface Guidelines,
which tell to always let the user choose its printer with the Chooser DA
and never do it inside a program.
However, regarding the high demand for such a feature, I offer you the
opportunity to do it within a script. So, to preserve the interface, never
forget to restore the previous setting after using these externals. (see
the script of this stack).
CurrPrinter 1.3
DESCRIPTION
------------
CurrPrinter is a XFCN which returns infos on the current printing device.
SYNTAX
--------
CurrPrinter ()
PARAMETERS
------------
No parameter required, but using "!", "?" or "=" as first parameter returns online help (resp. about, syntax and output).
USING
-----
The XFCN returns a one, two or three items string :
ΓÇó One item is returned if the printer is not shareable (like ImageWriter),
being the printer driver name of the System Folder.
ΓÇó Two items are returned if the printer is shareable (like LaserWriter)
and is on the current zone. They are respectively the printer driver
name and the printer name.
ΓÇó Three items are returned if the printer is shareable (like LaserWriter)
and is not on the current zone. They are respectively the printer driver
name, the printer name and the zone name.
If an error occurs, the XFCN can return :
"Error : Couldn't locate System folder"
"Error : Couln't get printer info"
"Error : Printer driver file is missing"
DeviceList 1.3
DESCRIPTION
------------
DeviceList is a XFCN which returns a list of available devices in a zone over the AppleTalk network. It can be used for any kind of devices, not only printers.
SYNTAX
--------
DeviceList(<driver name>[,<zone name>])
PARAMETERS
------------
<driver name> is the name of the driver file in the System Folder (or Extensions folder for System 7.0).
CAUTION : this has changed from last version which was expecting the device name. You now just have to supply the driver file name, and don't need anymore to know AppleTalk node name to use it.
<zone name> is the zone string. If missing, the device is assumed to be on the current zone.
Using "!", "?" or "=" as first parameter returns online help (resp. about, syntax and output).
USING
-----
The XFCN returns a list of items corresponding to the devices found on the network.
If an error occurs, the XFCN can return :
"Error : Out of Memory"
"Error : Couldn't locate System folder"
"Error : Missing or empty driver name"
"Error : Driver file not found"
"Error : Couln't get node name"
"Error : Couldn't open AppleTalk"
"Error : Out of memory"
"Error : Register failed"
"Error : Lookup failed"
"Error : Extract failed"
ChoosePrinter 1.3
DESCRIPTION
------------
ChoosePrinter is a XCMD allowing to select any printer, shareable or not on any zone.
put NameNewFile("New Folder","Select destination & name :") into DestPath
go this card
if DestPath Γëá empty
then
Answer "Copy files ?" with "No" or "Yes"
put (it is "Yes") into Files
set cursor to watch
put "Copying folder..."
CopyFolder ProvFolder,DestPath
get the Result
put empty
if it Γëá empty
then answer it
end if
end if
end mouseUp
</script>
</part>
<content>
<layer>card</layer>
<id>1</id>
<text>
CopyFolder 1.9
by Frédéric RINALDI
DESCRIPTION
------------
CopyFolder is a XCMD allowing to copy a whole folder, including all enclosed folders and files.
SYNTAX
-------
CopyFolder <folder path, name or pathname>[,<dest path or name>]
[,<files>][,"ResolveAlias"]
PARAMETERS
------------
<folder path, name or pathname> can be a single name or whole pathname. If just a single name is supplied, the folder is assumed to be in the same folder than the current stack.
<dest path or name> is optional. If not supplied, the file will be copied in the same folder as "Copy of...". If a single name is passed, the copy of the folder will take that new name in the same folder. If the second param end with colon, the folder will be copied in the designed folder and will keep its original name. Finally, a whole pathname can be provided to define both dest. directory and new folder name.
<files> is a boolean, making the XCMD copy or not the included files. With false, only the folder structure will be copied. Default is true.
"ResolveAlias" will be used when you want any alias file contained in the folder to be resolved before copying. In this case, the pointed files will be copied rather than their alias. Default is non-resolving aliases.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
If the copy is successfull, the Result will be empty. If an error occurs, either the copy will be aborted (fatal error), or may continue (non-fatal error on a file). The Result will then return one line for each found error, each line containing two items : <error description>,<file pathname>.
Error description can be one of these :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Volume is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : MacOS param error"
"Error : AppleShare insufficient privileges"
"Error : No more disk space"
"Error : Missing parameter(s)"
"Error : Couln't create copy buffer"
HISTORY
--------
1.9 : 03/18/92
ΓÇó Handling of non-fatal errors
ΓÇó Added "ResolveAlias" param
ΓÇó FinderLock attribute is preserved
1.8 : 03/13/92
ΓÇó Fixed folder privileges bug
1.7 : 12/25/91
ΓÇó Fixed alias file bug under System 7.0.1
ΓÇó Copy now keeps owner and group of shared folders
answer "Optionnal parameter :" with "R" or "I" or "None"
if it is "None"
then CopyRes ProvFile,DestFile,ResType,ResName
else CopyRes ProvFile,DestFile,ResType,ResName,it
get the Result
if first word of it is "Error"
then
beep
answer it
else answer "Copy done, result = ΓÇ£" & it & "ΓÇ¥"
end mouseUp
</script>
</part>
<content>
<layer>card</layer>
<id>1</id>
<text>
CopyRes 1.8 XCMD
by Frédéric RINALDI
DESCRIPTION
------------
CopyRes is a XCMD allowing to copy resources between two files. Unlike ResCopy, it doesn't simply replace existing resources with same name or ID without warning, and offers a wide range of error checking.
SYNTAX
-------
CopyRes <prov file>,<dest file>,<res type>,<res name or ID>[,<I | R | K>]
PARAMETERS
------------
Prov and dest file can be name or full pathname. With a single name, the file is assumed to be in the same folder than the current stack. Using "*" for any of these parameters will refer to the current stack pathname.
Res type must be a four char string, and is case sensitive.
The resource to copy can be invoked by its name or its ID.
Last parameter is optionnal, and can be any string beginning with "I", "R" or "K". Its allows to automatically renumber the copied resource, either Incremental or Random. Incremental will set an ID equal to the highest ID of the type plus one. Random will set any ID no already existing and over 1000. Using "K" (Krunch) will not ask what to do with existing resource having same name or ID and simply replace it.
Using "!" and "?" parameter will return an online help (resp. copyright and syntax).
USING
-----
In case of name or ID conflict, the XCMD will bring an ask dialog allowing to rename or renumber the resource to copy. Renumbering dialog proposes another non-existing ID. Clicking Cancel will abort the copy.
If the same name or ID is kept, then a second answer dialog pops to get confirmation for replacing the previous resource. Clicking Yes replaces the resource, No returns to first dialog and Cancel aborts the copy.
If the copy succeeds, The Result will return a two items string containing the name and ID of the copied resource.
If any error occurs, or the copy is aborted, the Result can return :
"Error : Missing Parameter(s)"
"Error : Param 5 must begin with R,I or K"
"Error : Bad Resource Type"
"Error : Same dest and prov file"
"Error : Volume Not Found"
"Error : File Not Found"
"Error : Path Not Found"
"Error : Unknown #xx"
"Error : Resource not found"
"Error : Copy failed"
"Error : Copy aborted"
HISTORY
--------
1.8 :
ΓÇó Added "K" param
1.7 :
ΓÇó Changed DetachResource to HandtoHand to avoid errors with HC 2.0.
1.6 :
ΓÇó code cleaned
ACKNOWLEDGEMENT
------------------
This stack uses FilePath XFCN, © 1898, 1990 Apple Computer, Inc.
</text>
</content>
<name>CopyRes 1.8*</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_8668.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
CreateFolder is a XCMD allowing to create a new folder on a volume.
SYNTAX
-------
CreateFolder <folder path>
PARAMETERS
------------
<folder path> can be a single name or whole pathname. If just a single name is supplied, the folder will be created in the same folder than the current stack.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
If the creation is successfull, the Result will be empty. If an error occurs, the Result can return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Not a directory"
"Error : Missing or empty parameter"
HISTORY
--------
1.2 : 06/18/91
ΓÇó Fixed a minor and rare bug
1.1 : 08/04/91
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "=" param for online help
</text>
</content>
<name></name>
<script></script>
</card>
card_9004.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
CreateStack is a XCMD that allows to create a new Stack from within a script, without user intervention.
SYNTAX
CreateStack <name or pathName>
PARAMETERS
If you supply only a name, the stack will be created at HyperCard's hierarchical level on the disk.
Help online is available : if you pass as first parameter :
"!" : the Result returns the version info
"?": the Result returns the syntax
USING
If no error occured, the Result will be empty. Otherwise, it can contain :
"Error : Bad Parameter Number"
"Error : Resource STDT not found"
"Error : Bad File Name"
"Error : Path Not Found"
"Error : Volume Not Found"
"Error : Creation aborted"
"Error : Create Failed"
"Error : FSDelete failed"
"Error : FSOpen failed"
"Error : FSWrite failed"
"Error : FSClose failed"
If a file with the same name already exists, the XCMD will ask if you want to replace it, or rename the stack to be created. If you choose to rename it, the the Result will return the created stack name.
This XCMD needs an auxillary resource STDT named "CreateStack". You can renumber it, but avoid renaming it !
</text>
</content>
<name>CreateStack 1.1</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_9593.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
ask "Date/time to convert :" with the date & "," & the time
if it is empty then exit mouseUp
answer it & " -> " & DateConverter(it)
get the time
convert it to seconds
ask "Seconds to convert :" with it
if it is empty then exit mouseUp
answer it & " -> " & DateConverter(it)
end mouseUp
</script>
</part>
<content>
<layer>card</layer>
<id>1</id>
<text>
DateConverter 1.0
by Frédéric RINALDI
DESCRIPTION
------------
DateConverter allows to convert date/time to seconds and backwards.
SYNTAX
--------
DateConverter(<date[,time[ AM|PM]]> | <seconds>)
PARAMETERS
------------
<date[,time[ AM|PM]]> is the date/time string. Since the XFCN is fully international, items order can differ in the date format. (ex for U.S.A. : "month/day/year"). Year can be 2 or 4 chars long.
Time is optional, and can be input in 12 ou 24 hours format, regardless of the country (ex : HH:MM:SS). Minutes and seconds are also optional.
Date and time must be separated by a colon in the string, leading zeros are not required.
<seconds> is an integer, which corresponds the the number of seconds since January 1. 1904.
Using "!", "?" and "=" as parameter will return an online help (resp. copyright, syntax and output).
USING
-----
Depending on the passed param (date/time or seconds), the XFCN will return the converted string (resp. seconds elapsed since January 1. 1904 and date/time string).
The date/time output string will be formatted according to international setttings.
ERRORS
-------
If an error occurs, DateConverter can return :
"Error : Incorrect date format"
"Error : Incorrect time format"
"Error : Couln't get INTL resource"
"Error : Cannot handle date before 1/1/1904"
"Error : Missing or empty parameter"
</text>
</content>
<name>DateConverter 1.0</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_10163.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
ask "Creator (4 chars) or full pathName :" with "WILD"
if it is empty then exit mouseUp
put it into Creator
ask "Volume : (Cancel for all)"
put it into Volume
answer "FullPath ?" with "True" or "False"
set cursor to watch
IF Volume Γëá empty
then put DocCreator(Creator,Volume,it) into cd fld 2
else put DocCreator(Creator,it) into cd fld 2
show cd fld 2
end mouseUp
</script>
</part>
<part>
<id>18</id>
<type>field</type>
<visible> <false /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>69</left>
<top>68</top>
<right>434</right>
<bottom>252</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name></name>
<script>on mouseUp
hide me
end mouseUp</script>
</part>
<content>
<layer>card</layer>
<id>1</id>
<text>
DocCreator 1.2
by Frédéric RINALDI
DESCRIPTION
------------
DocCreator returns the application name for a given creator of file pathName.
SYNTAX
--------
DocCreator(<file creator or pathName>[,<volume name>][,<find all>])
PARAMETERS
------------
<file creator or pathName> can be a creator (4 chars), a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
<volume name> is the name of volume to be explored. Default is all mounted volumes.
<find all> is a boolean allowing to choose to get all or only the latest application. Default is FALSE.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
DocCreator is able to use the System 7.0 enhanced desktop search features if active.
The XFCN returns a return delimited list of all matching applications. Duplicates are removed from the list before returning.
If an error occurs, DocCreator can return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Out of memory"
"Error : Missing parameter"
HISTORY
--------
1.2 : 08/04/91
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "=" param for online help
</text>
</content>
<name>DocCreator 1.2</name>
<script>
on opencard
end opencard
on closeCard
hide cd fld 2
put empty into cd fld 2
end closeCard
</script>
</card>
card_10501.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
DocTypes XFCN returns a list of all documents types that can be handled by an application.
SYNTAX
--------
DocTypes(<appl path>)
PARAMETERS
------------
<appl path> can be a single name or whole pathname. If just a single name is supplied, the application is assumed to be in the same folder than the current stack.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The XFCN returns a comma separated list of available types.
If an error occurs, DocTypes can return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Missing pathname"
"Error : Empty pathname"
"Error : Could't find FREF resource"
"Error : Couldn't build result"
HISTORY
-------
1.5 : 08/04/91
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "=" param for online help
This stack uses FilePath XFCN, © 1898, 1990 Apple Computer, Inc.
</text>
</content>
<name>DocTypes 1.5</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_11120.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
DoMenu XCMD enhances HyperCard 2.0 by allowing to choose to paste text only or styled text.
SYNTAX
--------
doMenu <item name>
PARAMETERS
------------
Item name is the name of the menu item to call.
USING
-----
Just copy DoMenu XCMD in your Home or start using this stack. All doMenu messages sent thru the hierarchy (by script of pulling down menu) will be trapped by the XCMD, acting as a filter for "Paste Text" item name.
So, regular pasting will paste unstyled text in the destination field, while holding simultaneously the shift key down when pasting will paste the styled text. Since most pasting doesn't need style, just install and forget it.
</text>
</content>
<name>DoMenu 1.0</name>
<script>
on opencard
end opencard
on closeCard
hide cd fld 2
put empty into cd fld 2
end closeCard
</script>
</card>
card_11622.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
EraseFile is a XCMD allowing to delete a file on a volume.
SYNTAX
-------
EraseFile <file path|name>[,"DontResolveAlias"]
PARAMETERS
------------
<file path|name> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
"dontResolveAlias" allows to deal with an alias file itself (System 7.0 only) rather than with the file pointed by it.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The Result will be empty if the file has been deleted. If an error occurs, it can contain :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Missing or empty parameter(s)"
"Error : Second param can only be ΓÇ£DontResolveAliasΓÇ¥"
HISTORY
--------
1.1 : 08/04/91
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "DontResolveAlias" parameter
ΓÇó Added "=" param for online help
This stack uses FilePath XFCN, © 1898, 1990 Apple Computer, Inc.
</text>
</content>
<name>EraseFile 1.1</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_12229.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<Text> is the original list of many lines of one or more items.
<Item Nb> is a positive non zero integer giving the item number(s) to extract from the text.
<item sep> and <line sep> are both a single char defining respectively the item and line separators. Default is comma fior itemSep (or the current value of the itemDelimitert property under HC 2.1), return for lineSep.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The XFCN returns the extracted list.
If an error occurs, ExtractItems can return :
"Error : Out of memory"
"Error : Missing parameter(s)"
"Error : Bad item number #x"
HISTORY
-------
1.4 : 05/17/92
ΓÇó Fixed again itemDelimiter handling
1.3 : 04/27/92
ΓÇó Fixed itemDelimiter/HC 2.0v2 bug
1.2 : 03/13/92
ΓÇó Added LineSep and ItemSep params
</text>
</content>
<content>
<layer>card</layer>
<id>16</id>
<text> Original Extracted</text>
</content>
<content>
<layer>card</layer>
<id>17</id>
<text>1,2,3,4,5
toto,titi,tata,tete
1,2,,,6
toto,titi,tata,tete
1,2,3,4,5
toto,titi,tata,tete
1,2,3,4,5
toto,titi,tata,tete
1,2,3,4,5
toto,titi,tata,tete
1,2,3,4,5
toto,titi,tata,tete
1,2,3,4,5
toto,titi,tata,tete
</text>
</content>
<name></name>
<script></script>
</card>
card_3055.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
put NewFileName("Select destination & name :","New File")¬
into DestFile
if DestFile Γëá empty
then
set cursor to watch
put "Copying File..."
FileCopy ProvFile,DestFile
get the Result
put empty
if it Γëá empty
then answer it
end if
end if
end mouseUp
</script>
</part>
<content>
<layer>card</layer>
<id>1</id>
<text>
FileCopy 2.0
© Frédéric RINALDI
DESCRIPTION
------------
FileCopy is a XCMD allowing to copy any file between two volumes or directories.
SYNTAX
-------
FileCopy <file path, name or pathname> [,<dest path or name>]
[,<replace>][,"DontResolveAlias"]
PARAMETERS
------------
<file path, name or pathname> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
<dest path or name> is optional. If not supplied, the file will be copied in the same folder as "Copy of...". If a single name is passed, the copy of the file will take that new name in the same folder. If the second param end with colon, the file will be copied in the designed folder and will keep its original name. Finally, a whole pathname can be provided to define both dest. directory and new file name.
<replace> is a boolean allowing to automatically replace any existing file. Default is FALSE.
"dontResolveAlias" allows to deal with an alias file itself (System 7.0 only) rather than with the file pointed by it.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
If the copy is successfull, the Result will contain the full pathname of the destination file. If an error occurs, the Result can return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Volume is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : No more disk space"
"Error : Missing or empty parameter(s)"
"Error : Couln't create copy buffer"
HISTORY
-------
2.0 : 06/19/92
ΓÇó Enhanced to allow copy in an AppleShare drop-folder
FileIsOpen allows to test if a file is already open or not.
SYNTAX
--------
FileIsOpen <File path>
PARAMETERS
------------
<File path> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The XFCN return "true" is the file is open, "false" if not.
If an error occurs, FileIsOpen can return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Missing or empty parameter"
HISTORY
--------
1.1 : 08/04/91
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "=" param for online help
This stack uses FilePath XFCN, © 1898, 1990 Apple Computer, Inc.
</text>
</content>
<name>FileIsOpen 1.1</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_13801.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
FileMaker is a set of two XCMDs : FileToRes and ResToFile. These two externals allow to create any type of document, empty or already filled, from within a script and reopen it with the original application.
FileToRes 1.1
------------
SYNTAX
-------
FileToRes <file path or name>,<DATA res name>
PARAMETERS
------------
<file path or name> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
<DATA res name> is the name which will take the created DATA resource in the current stack.
Using "!", "?" and "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
------
The XCMD can generate DATA resource from any kind of file with no resource fork. Along with the datas, the file type, creator and flags are put in the DATA resource in order for ResToFile XCMD to regenerate exactly the same file than the original.
If a DATA resource already exists with the same name, a dialog will be prompted for the user to choose to rename, replace or cancel. If rename is choosen, a second dialog will ask for the new name, and the Result will return the changed name. With replace, the previous resource will be overwritten.
If you plan to capture a stack, compact it before in order to get the smallest resource as possible.
If an error occurs, the Result can return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Missing or empty parameter(s)"
"Error : Creation aborted"
"Error : Old DATA res could't be removed"
"Error : Couldn't clear DATA resource"
"Error : Creation aborted"
"Error : This file has a resource fork"
"Error : Out of memory"
"Error : Couldn't build resource"
"Error : Couldn't create DATA resource"
HISTORY
--------
1.1 : 08/04/91
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "=" param for online help
ResToFile 1.1
------------
SYNTAX
-------
ResToFile <name or pathName>,<DATA res name>
PARAMETERS
------------
<file path or name> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
<DATA res name>is the name of the DATA resource which will be used to re-create the original file.
Using "!", "?" and "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
------
The XCMD uses DATA resource previously created by FileToRes XCMD to rebuild the whole file. Since file type, creator and flags were preserved, the rebuilt file is exactly the same than the original.
If a file already exists with the same name, a dialog will be prompted for the user to choose to rename, replace or cancel. If rename is choosen, a second dialog will ask for the new name, and the Result will return the changed name. With replace, the previous file will be overwritten.
If an error occurs, the Result can return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Missing or empty parameter(s)"
"Error : DATA res "name" not found"
"Error : No more disk space"
"Error : Creation aborted"
"Error : Creation aborted"
To test these XCMDs, just click on buttons below. A DATA resource named
"TestStack" is already in the stack for testing purpose. It will create a stack template with two cards, script and objects.
HISTORY
----------
1.1 : 08/04/91
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "=" param for online help
This stack uses FilePath XFCN, © 1898, 1990 Apple Computer, Inc.
</text>
</content>
<content>
<layer>card</layer>
<id>8</id>
<text>
</text>
</content>
<content>
<layer>card</layer>
<id>16</id>
<text>This XFCN is FreeWare,allowing unlimitted use in any non-commercial stack.
You just need in this case to mention the author's name in the stack.
Any commercial use must be licenced and aknowledged by the author.</text>
</content>
<name>FileMaker 1.1</name>
<script>
on opencard
end opencard
on closeCard
ls
hide btn 2
hide cd fld 2
hide cd fld 3
end closeCard
</script>
</card>
card_14209.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
FolderSize XFCN returns the physical size of any folder or volume.
SYNTAX
--------
FolderSize(<folder pathname>[,<logical size>])
PARAMETERS
------------
<folder pathname> can be a single name or whole pathname. If just a single name is supplied, the folder is assumed to be in the same folder than the current stack.
<logical size> is a boolean for choosing between logical and physical size. Default is logical size (TRUE).
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The XFCN returns the physical size in bytes of the folder or volume. This value can be different from the folder size given by the Finder Info, since the Finder adds the logical size of each enclosed file. The physical size is more accurate, since you can use it to know how much space you really need to copy that folder.
If an error occurs, FolderSize can return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Couln't open working directory"
"Error : Couln't close working directory"
"Error : Missing or empty parameter"
"Error : Second param must be boolean"
HISTORY
--------
1.1 : 08/04/91
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
• Added <logical size> param
ΓÇó Added "=" param for online help
This stack uses FolderPath XFCN, © 1898, 1990 Apple Computer, Inc.
</text>
</content>
<name>FolderSize 1.1</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_15241.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
This stack contains two externals, FontInfos XFCn & FontRenum XCMD, which allow to handle fonts withing files.
FontInfos 1.2
DESCRIPTION
------------
FontInfos returns full information on fonts in a file according to the FOND resources.
SYNTAX
--------
FontInfos(<file name or pathName>[,<item delim>[,<line delim>]])
PARAMETERS
------------
<file name or pathName> can be a single name or whole pathname of a file or of an alias pointing to it. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
<item delim> allows to use an unusual item delimiter. Default is comma.
<line delim> allows to use an unusual line delimiter. Default is return.
Using "!", "?" and "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The XFCN returns a return delimited list of entries, each entry having the following items :
1) name : name of FOND resource
2) ID : ID of FOND resource
3) flag 1 : true is there's an image-height table
4) flag 2 : true is there's an character-width table
5) flag 3 : true when FractEnable should be ignored
6) flag 4 : true to use integer extra width style variation
7) flag 5 : true when family width table should be ignored
8) flag 6 : true for fixed-width font
9) famID : family ID number
10) firstChar : ASCII code of the first char
11) lastChar : ASCII code of the last char
12) ascent : maximum ascent for 1 pt font
13) descent : maximum descent for 1 pt font
14) leading : maximum leading for 1 pt font
15) widMax : maximum width for 1 pt font
16) property 1 : extra width for bold text
17) property 2 : extra width for italic text
18) property 3 : extra width for underline text
19) property 4 : extra width for outline text
20) property 5 : extra width for shadow text
21) property 6 : extra width for condensed text
22) property 7 : extra width for extended text
23) version : version number
…) assoc 1[…,assoc N] : font association table for each corresponding
NFNT or FONT resource, where each <assoc> is a
four items string :
"fontSize,fontStyle,resource type,resource ID"
fontStyle containing one or more words giving
the style(s).
ERRORS
-------
If an error occurs, FontInfos can return :
"Error : Not a file"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : I/O Error"
"Error : No resource fork"
"Error : AppleShare insufficient privileges"
"Error : Out of memory"
"Error : Missing or empty parameter"
"Error : No FOND resource"
HISTORY
--------
1.2 10/10/91
ΓÇó remove dummy SysBeep occuring with System < 6.0.7
ΓÇó added sfnt resource support
1.1 10/03/91
ΓÇó added resource type in each entry of font association table
FontRenum 1.2
DESCRIPTION
------------
FontRenum allows to renumber a FOND resource or associated FONT/NFNT/sfnt resources.
SYNTAX
--------
FontRenum <file name or pathName>,<FOND name>,
<sfnt/NFNT/FONT current id>,<sfnt/NFNT/FONT new id>
PARAMETERS
------------
<file name or pathName> can be a single name or whole pathname of a file or of an alias pointing to it. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
<FOND name> is a string giving the FONF resource name (ie name of the font). Passing "FOND" in this parameter allows to renumber the FOND resource itself rather than linked resources.
<sfnt/NFNT/FONT current id> is an integer giving the current resource id.
<sfnt/NFNT/FONT new id> is an integer giving the desired new id.
Using "!", "?" and "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
Renumbering sfnt/NFNT/FONT resources also updates its ID entry in the font association table of the FOND resource.
ERRORS
-------
If an error occurs, FontRenum can return :
"Error : Not a file"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : I/O Error"
"Error : No resource fork"
"Error : AppleShare insufficient privileges"
"Error : Missing or empty parameter(s)"
"Error : Incorrect current ID"
"Error : Incorrect new ID"
"Error : FOND resource not found"
"Error : FONT/NFNT entry not found in FOND resource"
HISTORY
--------
1.2 10/15/91
ΓÇó FamID is changed when FOND resource is renumbered
1.1 10/10/91
ΓÇó remove dummy SysBeep occuring with System < 6.0.7
ΓÇó added sfnt resource support
</text>
</content>
<content>
<layer>card</layer>
<id>17</id>
<text> 1) name
2) ID
3) flag 1
4) flag 2
5) flag 3
6) flag 4
7) flag 5
8) flag 6
9) famID
10) firstChar
11) lastChar
12) ascent
13) descent
14) leading
15) widMax
16) property 1
17) property 2
18) property 3
19) property 4
20) property 5
21) property 6
22) property 7
23) version
font assoc table</text>
</content>
<content>
<layer>card</layer>
<id>20</id>
<text>Courier
22
false
false
false
false
true
true
22
0
255
8
4
5
11
0
0
0
0
0
-341
341
3</text>
</content>
<content>
<layer>card</layer>
<id>21</id>
<text>0,Plain,sfnt,6000
</text>
</content>
<name>FontMaster 1.2</name>
<script>
on opencard
end opencard
on closecard
showHide false
end closecard
on showHide How
ls
repeat with i=2 to 4
if i > 2
then set visible of btn i to How
set visible of cd fld i to How
end repeat
end showHide
on DisplayResult
global FondNb,FondResult
set cursor to watch
if FondNb Γëñ number of lines of FondResult
then
repeat with i=1 to 23
put item i of line FondNb of FondResult into line i ¬
of cd fld "Result"
end repeat
set scroll of cd fld "List" to 0
put empty into cd fld "List"
repeat with i=24 to number of items of line FondNb of FondResult
if (i mod 4 Γëá 0) and i Γëá 24
then next repeat
put item i to i+3 of line FondNb of FondResult & return¬
after cd fld "List"
end repeat
add 1 to FondNb
end if
end DisplayResult
</script>
</card>
card_48568.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
FormatNum allows, like ExcelΓäó, to format numbers according to their sign.
SYNTAX
-------
FormatNum(<number>[,<format string>])
PARAMETERS
-------------
<number> is the number to format.
<format string> is a string defining the output format. Its shaped as :
<format if positive[;format if negative[;format if null]]>
Using "!", "?" and "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
Each format can contain the chars #0^.,'\+-%E(). Filling is always done from the right. Format must provide at least as many chars as digits in the number.
ERRORS
-------
If an error occurs, FormatNum can return :
"Error : Missing or empty parameter"
"Error : Couldn't access partsTable"
"Error : Bad format string"
HISTORY
--------
1.0 17/07/92
ΓÇó First public release
</text>
</content>
<name></name>
<script></script>
</card>
card_15698.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
FullBalloons "ShowDirect","This is a showDirect call"
end mouseEnter
on mouseUp
get short name of me
if last word of it is "OFF"
then
put "ON" into last word of it
FullBalloons "Off"
else
put "OFF" into last word of it
FullBalloons "On"
end if
if first word of the Result is "Error"
then answer the Result
else set name of me to it
end mouseUp</script>
</part>
<part>
<id>17</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>3</left>
<top>0</top>
<right>88</right>
<bottom>18</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script>on mouseEnter
FullBalloons "ShowPICT",5000
end mouseEnter</script>
</part>
<part>
<id>18</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>246</left>
<top>15</top>
<right>369</right>
<bottom>61</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script>on mouseEnter
FullBalloons "ShowStr#","5000,2"
end mouseEnter</script>
</part>
<part>
<id>19</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>120</left>
<top>15</top>
<right>241</right>
<bottom>61</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script>on mouseEnter
FullBalloons "ShowStr#","5000,1"
end mouseEnter</script>
</part>
<part>
<id>20</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>403</left>
<top>2</top>
<right>430</right>
<bottom>20</bottom>
</rect>
<style>transparent</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script>on mouseEnter
FullBalloons "ShowTEXT",5000
end mouseEnter</script>
</part>
<part>
<id>23</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <false /> </lockText>
<rect>
<left>136</left>
<top>306</top>
<right>394</right>
<bottom>327</bottom>
</rect>
<style>shadow</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<textHeight>16</textHeight>
<name></name>
<script>on mouseEnter
FullBalloons "ShowField",the target
end mouseEnter
on openField
FullBalloons "remove"
end openField</script>
</part>
<content>
<layer>card</layer>
<id>1</id>
<text>
FullBalloons 1.0
by Frédéric RINALDI
Yet another HyperCard Balloon Help external ? Nope. Just because I think that the previous sets provided by other developers dont fit the real user needs, have too impenetrable parameters, are simply buggy or hard to implement, or miss some features provided by Help Mgr. So, once again, I wrote it by myself, assuming that :
ΓÇó One global XCMD is the best approach, since most of time result is not needed if the external is well done.
ΓÇó It must check for Help Mgr availability rather than simply bomb under System 6 (don't laugh, I've got one like that !)
ΓÇó All parameters must be case insensitive to be more user-friendly, and whenever possible, be in any order in the external call (read EDGE !)
ΓÇó One HyperTalk statements with two minimal parameters must fit 90% of the needs, including auto-removing, correctly placing the tip, etc...
ΓÇó No user has to deal with variant code 0..7 to set the tip location on the balloon. Who can remember that, when "topLeft" or "rightBottom" are self-explaining ?
ΓÇó Styled text is available in Balloon Help so why not implement it also ?
DESCRIPTION
------------
FullBalloons allows to add Balloon Help in a stack.
Only param 1 is only needed param, param 2 is needed only when param 1 is "show…". All other params are optional and can be in any order.
<action> is the action string, of course case insensitive, and can be :
on : turn balloon Help on
off : turn balloon Help off
isOn : test if Balloon Help is on or off
isShowing : test if a balloon is currently showing
showDirect : show a balloon using litteral parameter
showPICT : show a balloon using a PICT resource
showSTR : show a balloon using a STR resource
showSTR# : show a balloon using a STR# resource
showField : show a balloon using styled text from a field
ShowTEXT : show a balloon using TEXT and styl resources
remove : remove currently showing balloon
<balloon content> is only needed when first param begins with "show…". Depending on choosen action, this param will be :
showDirect : a litteral string or any container
showPICT : a PICT resource ID
showSTR : a STR resource ID
showSTR# : a two item string "ID,index" where ID the the STR#
resource ID and index the string number in it.
showField : a string giving the field descriptor. It can be any valid
descriptor (name, number or ID), and must be enclosed
in quotes (like "cd fld 1" or "bg fld id 52")
ShowTEXT : a TEXT/styl resources ID
<tipLoc> is a point giving the location of the balloon tip. Default is the current mouseLoc.
<hotRect> is a rect giving the area where the balloon disappears as soon as the mouse is not in anymore. Default is the rect of target object, since calls to FullBalloons use MouseEnter handler.
<tipPosition> is the position of the tip on the balloon. Default is leftTop, but the Help Mgr always can change it to make the balloon fit on screen. If you want to force it the a specific position, the parameter can be :
Using "!", "?" and "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
FullBalloons is usually callled in a MouseEnter handler. Since balloon disposing is automatic, no mouseLeave handler is needed.
With unlocked fields, a good practice is the hide the balloon as soon as clicked in the field :
on openField
FullBalloons "remove"
end openField
You don't need to test for Balloon Help state (on/off) before calling showBalloon "show…". The external doest it for you.
You don't need to test for that summy -853 error code coming from a too quick cursor movement, nor need a special handler for it. Once again, that stuff is done by the XCMD.
Since Help Mgr is quite slow, quickly moving the mouse around can sometimes be too fast for mouseEnter messages to be send. One good workaround is too add in the stack script :
on mouseWithin
get word 1 to 2 of the target && number of the target
FullBalloons "IsShowing"
if not the Result and it Γëá the selectedField
then send mouseEnter to the target
end mouseWithin
ERRORS
-------
If an error occurs, FullBalloons can return :
"Error : Balloons Help not supported"
"Error : Missing or empty parameter"
"Error : Bad action parameter"
"Error : Missing balloon content parameter"
"Error : Missing STR# index"
"Error : Bad field descriptor"
"Error : TEXT resource cannot exceed 255 chars"
"Error : HotRect defined twice"
"Error : TipLoc defined twice"
"Error : TipPosition defined twice"
"Error : Bad tipPosition parameter"
"Error : Out of memory"
"Error : Resource not found"
</text>
</content>
<content>
<layer>card</layer>
<id>23</id>
<text>Editing field just for fun…
</text>
</content>
<name>FullBalloons 1.0</name>
<script>
on opencard
FullBalloons "IsOn"
if the Result is true
then set name of btn 1 to "Désactiver l'aide bulles"
else set name of btn 1 to "Activer l'aide bulles"
end opencard
on closeCard
end closeCard
on mouseWithin
get word 1 to 2 of the target && number of the target
FullBalloons "IsShowing"
if the Result is false and it Γëá the selectedField
then send mouseEnter to the target
end mouseWithin
</script>
</card>
card_16310.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<rect(s)> can be a single rect, or a return delimited list of many rectangles.
<limit rect> defines the maximal area for dragging.
<test> string is an HyperTalk boolean statement (like "the mouseLoc is within rect of fld 1") which will be repetitivly evaluated while dragging.
<if true> and <if false> are two Hypertalk statement string which will be executed when the test string will return true or false.
As usual, using "!", "?" et "=" returns online help (resp. about, syntax and output).
USING
-----
If the mouse button is released within limit rect, the XFCN will return a two items string "x,y" corresponding to the horizontal and vertical move from the original point. If the mouse is released outside, the result will be empty.
Holding shift key allows to constraint move to horizontal or vertical axis.
ERRORS
-------
If an error occurs, the XFCN can return :
"Error : Missing or empty rect parameter"
"Error : Incorrect rect in param #1"
"Error : Incorrect limit rect"
"Error : Incorrect Test string"
"Error : Missing action if true"
HISTORY
--------
1.3 06/28/92
ΓÇó Fixed bug with rapid double-click.
1.2 02/23/92
ΓÇó Fixed pattern bug with SuperCard.
ΓÇó Constraint detection has been enhanced
1.1 12/26/91
ΓÇó Changed way to pass parameter to FilterProc
ΓÇó Refresh of screen on output
ΓÇó Added move constraints
</text>
</content>
<name></name>
<script>on DoMove
put rect of btn 1 & return & rect of btn 2 into RectList
put fulldrag(RectList,"0,0,512,342",¬
"the mouseLoc is within rect of btn 3",¬
"set icon of btn 3 to 131",¬
"set icon of btn 3 to 130") into Move
if first word of Move is "Error"
then
answer Move
else
repeat with i=1 to 2
get loc of btn i
add item 1 of Move to item 1 of it
add item 2 of Move to item 2 of it
set loc of btn i to it
end repeat
end if
end DoMove</script>
</card>
card_16663.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
Only first param is required, all other are optional.
<menu> is the popup menu definition text. For a single menu, item separator char can be return, comma or semicolon. For a hierarchical menu, item separator can be return or semicolon, while subitems separator will be comma.
If this param is exactly a four char string (like "FONT" or "XCMD"), the XFCN will automatically build a menu containing all resource names of the defined type.
Any usual metacharacter can be used in string :
^XXX associates an ICON resource to the item
!X puts a X mark char before the item
<X sets the style of the item (B, I, O, U, S)
NOTE : Menu Mgr doesn't allow <E (extend) and <C (condense)
/X associates a command key to the item
( disables the item
and a special hack :
¨XXX associates an SICN resource to the item
<loc> is a point "h,v" giving the topleft corner of the selected item of the menu when it pops on screen. Default is the topleft of the target button or field, or the current mouseLoc when used without field or button.
<selected item> is an integer giving the item number that will appear right at the cursor location when the menu pops. With 0, the menu will drop down from its top. With a positive value, the item will be checked, while a negative value will just position the item without checking it. If this param is not used, the XFCN will automatically check the item corresponding to the the target button name of field content.
<Font[,size]> is a one ot two items string allowing to force a font and size for the menu. Default setup uses the font and size of the target object.
<checkMark> is a single char giving the checkmark char. Default uses the regular check for Chicago, "√" for any other font.
<sub owner select> is a boolean that will enable of disable the feature that allows to even select an item having a submenu. Default is true.
"fastest" allows to disable smart features from FullHPop, thus make it respond as fast as possible. But the drawback of it is that items will not be capitalized anymore, ICON ID must be computed as usual (see IM I-346 to 349), and SICN recources become unavailable.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The XFCN must ne called in a mouseDown handler from either a button or a field.
The first line returns informations about the selected item and subitem, while the second gives the selection string width according to menu font and size. This information is intended to give the user ability to resize the calling object to respect interface.
If the mouse button is released outside the menu, the result will be empty.
ERRORS
-------
If an error occurs, FullHPop will return :
"Error : Bad ICON or SICN ID (257 Γëñ x Γëñ 511)"
"Error : Cannot exceed 127 submenus"
"Error : Missing or empty parameter(s)"
"Error : Empty param #x"
"Error : Bad font size"
"Error : Incorrect param #x"
"Error : No such resource"
HISTORY
-------
1.3 10/26/91
ΓÇó "-" char can be preceeded by prefix char "\" as well.
1.2 10/14/91
ΓÇó Added mouseLoc default loc for card click
ΓÇó Fixed font attributes handling when no target font property is available
ΓÇó Fixed prefix char routine
1.1 10/09/91
• Negative loc values now accepted as parameter
• Added "\" prefix char for metacharacters in string
<prov path> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
<dest path> must not include the name of the item to move, but just its path.
"dontResolveAlias" allows to deal with an alias file itself (System 7.0 only) rather than with the file pointed by it.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
If an error occurs, FullMove can return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Missing or empty parameter(s)"
"Error : Third param can only be "DontResolveAlias""
"Error : Cannot move to different volume"
"Error : Same prov and dest folder"
HISTORY
--------
1.1 : 08/04/91
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "DontResolveAlias" parameter
ΓÇó Added "=" param for online help
This stack uses FilePath & FolderPath XFCNs, © 1898, 1990 Apple Computer, Inc.
</text>
</content>
<name>FullMove 1.1</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_12862.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<folder path|name> can be a single name or whole pathname of a file or folder. If just a single name is supplied, file or folder is assumed to be in the same folder than the current stack.
"dontResolveAlias" allows to deal with an alias file itself (System 7.0 only) rather than with the file pointed by it.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
ERRORS
-------
If the remove is successfull, the Result will be empty. If an error occurs, the Result can return :
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Missing or empty parameter(s)"
"Error : Second param can only be "DontResolveAlias"
HISTORY
--------
1.0 08/12/91
This stack uses FilePath & FolderPath XFCNs, © 1898, 1990 Apple Computer, Inc.
</text>
</content>
<name>FullRemove 1.0</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_18815.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<file/folder pathname> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
<new name> is a simple string.
"dontResolveAlias" allows to deal with an alias file itself (System 7.0 only) rather than with the file pointed by it.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
If an error occurs, FullRename can return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Missing or empty parameter(s)"
"Error : Seconds params must be a single name"
"Error : Third param can only be "DontResolveAlias""
HISTORY
-------
1.4 06/09/92
ΓÇó Fixed volume renaming when file has the same name
1.3 03/10/92
ΓÇó Fixed volume renaming
1.2 : 12/25/91
ΓÇó Fixed alias file bug under System 7.0.1
1.1 :
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "DontResolveAlias" parameter
ΓÇó Added "=" param for online help
This stack uses FilePath XFCN (© 1898, 1990 Apple Computer, Inc.)
LeafName XFCN (by Kevin CALHOUN), FolderName XFCN (by Eric CARLSON ,and Anup MURARKA)
</text>
</content>
<name></name>
<script></script>
</card>
card_19304.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<replace pattern> is the replacement string to search for. It may be empty.
<all> is a boolean, telling if all matches (true) must be handled, or only the first one (false). Default is true.
<offset> is the char number at which the search will begin. Default is 1.
Using "!" and "?" returns online help (resp. about and syntax).
USING
------
FullReplace will return the input text, once replacement done. Pattern searching is not cas sensitive.
If an error occurs, FullREplace will return :
"Error : Missing parameter(s)"
"Error : Param #4 must be boolean"
"Error : Param #5 must be > 0"
HISTORY
-------
1.1 02/23/92
ΓÇó Search no more limited to 32000 chars
</text>
</content>
<content>
<layer>card</layer>
<id>17</id>
<text>This (thΓÇósΓÇó) ΓÇóxtΓÇórnal(s) is (arΓÇó) FrΓÇóΓÇóWarΓÇó,allowing unlimitΓÇód usΓÇó in any non-commΓÇórcial stack. You just nΓÇóΓÇód in this casΓÇó to mΓÇóntion thΓÇó author's namΓÇó and copyright in your stack.
Any commΓÇórcial usΓÇó must bΓÇó licΓÇónsΓÇód and aknowlΓÇódgΓÇód by thΓÇó author.
In order to keep parameter coherency in version 2.0, previous <fileName> param has changed to "W=<fileName>". So you should add the "W=" prefix in your calls.
DESCRIPTION
------------
FullResList allows to get a list of resources informations for any file, or even to test if a resource is present.
<T=ALL|Type1[…,TypeN]> allows to define one or more types of resources to list. Default is "T=ALL".
<N=res name> defines the resource name to search.
<I=res id> defines the resource id to search.
<W=ALL|fileName> defines the resource file to search in. <fileName> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack. Aliases are also supported. Default is current stack. If "ALL" is used, all accessible resources will be returned (Current stack + stacks in use + Home + HyperCard + System).
<O=A|T|N|S|I|W[…A|T|N|S|I|W]> allows to define the output format of returned list resource entries. Order and components can be freely choosen using A (attributes), T (type), N (name), S (size), I (ID) and W (where). Default is "O=TNI".
Attributes are returned as string that can contain any combination of :
C (changed), R (pReload), P (Protected), L (Locked), U (pUrgeable)
and S (Sustem heap).
Using "!", "?" and "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The XFCN returns a return delimited list of entries formatted according to given output mask. Informations in each entry are comma delimited.
Logical AND is computed with params "T=", "N=" and "I=".
ERRORS
-------
If an error occurs, FullResList can return :
"Error : Out of memory"
"Error : Empty parameter #x"
"Error : Missing information following "X=""
"Error : Out of memory"
"Error : Bad resource ID"
"Error : "X" not allowed in output mask"
"Error : This file has no resource fork"
"Error : Param #x must begin with T,N,I,O or W"
"Error : Bad parameter format"
"Error : Out of memory"
"Error : No resources found"
"Error : Bad resource type"
"Error : Not a file"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : I/O Error"
HISTORY
--------
2.0 : 04/27/92
ΓÇó Added "N=" and "I=" params
ΓÇó Changed <fileName> param to "W=<fileName>"
ΓÇó Added "W" for output mask, allowing to know in which file each resource was found (useful with "T=ALL").
1.3 : 12/25/91
ΓÇó Fixed alias file bug under System 7.0.1
1.2 11/12/91
ΓÇó Added ALL in file param
1.1 10/25/91
ΓÇó Fixed minor bug due to openRFPerm
1.0 10/24/91
ΓÇó First release
</text>
</content>
<content>
<layer>card</layer>
<id>19</id>
<text>XFCN,ATalkZones,5263
XFCN,CapsLock,8652
XFCN,ChooseColor,1578
XFCN,DeviceList,521
XFCN,CurrPrinter,1842
XFCN,Switch,801
XFCN,ClipInfo,6523
XFCN,NewFileName,1008
XFCN,FolderName,1290
XFCN,FilePath,1120
XFCN,DateConverter,6871
XFCN,DocCreator,2658
XFCN,DocTypes,8653
XFCN,ExtractItems,8569
XFCN,FileIsOpen,1856
XFCN,FindFolder,3956
XFCN,FolderPath,12551
XFCN,FolderSize,5547
XFCN,FontInfos,4985
XFCN,FullDrag,5623
XFCN,FullFind,1875
XFCN,FullHPop,1298
XFCN,LeafName,1222
XFCN,FullResList,3385
XFCN,FullSFPack,4498
XFCN,FullSFPut,6325
XFCN,FullSort,1652
XFCN,GetBootVol,500
XFCN,GetDir,12552
XFCN,GetFInfo,5624
XFCN,MacType,816
XFCN,GetMode,857
XFCN,GetPassWord,2458
XFCN,GetSysFolder,501
XFCN,GlobalList,2756
XFCN,IsFile,2136
XFCN,IsFinderLocked,5625
XFCN,IsFolder,12553
XFCN,IsObject,6851
XFCN,LineCount,2563
XFCN,ListLogic,9561
XFCN,ListSelect,800
XFCN,NubusList,5555
XFCN,PPCList,9856
XFCN,Privileges,1985
XFCN,ResText,1685
XFCN,StrWidth,12554
XFCN,FullOffset,6698
XFCN,FullReplace,7841
XFCN,GetVInfo,2236
XFCN,ResolveAlias,8855
XFCN,StripDup,8332
XFCN,Align,856
XFCN,SelectDir,8854
XFCN,NameNewFile,8954
XFCN,FormatNum,4444
XFCN,HowMany,5621
XFCN,ReplaceCharSet,5526
XFCN,SelectFile,8562
XFCN,Switch,10000
XFCN,XRef,1999</text>
</content>
<name></name>
<script></script>
</card>
card_20455.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
FullSFPack allows to use standard dialogs for seleting a file, folder or volume. It allows even to deal with Alias files themselves rather than with pointed entries, and adds a multiple files selection dialog.
<G[et]|P[ut]|V[olume]|F[older]|M[ultiple]|Q[uickTime]> is the action param and defines the desired dialog.
<type 1[…,type 4]> is a 1 to 4 items list containing types of files to display in the dialog. Default presents all files.
<default dir> is a full pathname string allowing to set the current directory when the dialog pops on screen.
<new name> is a string only needed with "P[ut]", and gives the default name for the new file in the dialog's edit field.
<prompt> is the message string appearing in the dialog.
"dontResolveAlias" allows to get the alias file pathName rather than those from the pointed file. Applies only to G[et] and M[ultiple].
Using "!", "?" or "=" as first parameter will return an online help (resp.
USING
------
FullSFPack requires System 7.0.
The XFCN returns the full patname of the selected file, folder or volume.
With "M[ultiple]", it returns a return delimited list of all collected files.
Q[uickTime] option require QuickTime to be installed, and allows viewing and on-the-fly creation of PICT and MooV file previews.
FullSFPack doesn't need any associated DLOG/DITL resources, and is able to create them on the fly when needed.
MeanWhile, when called from a stack on a locked volume, the XFCN isn't able to add those new resources to the current stack. That's why resources have been provided in this stack, and the XFCN detects their availability.
Finally, on locked volume, if you forgot to copy these needed DLOG/DITL resources, FullSFPack still tries to work by using standard resources from the System (except for M[ultiple] and F[older] which always need custom dialog). Only difference : there will be no prompt displayed.
Depending on requested action, you will need to add the following resources (don't rename them !) :
Prompt is a string that will appear as prompt in the disalog.
Default is the default name to show in the edit field of the dialog.
Initial folder is a pathname of the folder hierarchy that will be displayed when the dialog pops. Default value is the current stack's folder.
MaxLen is an integer (>0 and <256) that will limit the length of the input string. A beep will sound as soon as the user tries to override this limit. Default value is 255.
As usual, using "!" and "?" returns online help (resp. about and syntax).
USING
-----
The XFCN returns a two lines string, being respectively the name and the path choosen by the user.
[,"c=char x|word x|item x[ to y]"] [,<sort list>] )
PARAMETERS
------------
Except for the first parameter, each parameter is optional, can come in any order and is, of course, not case-dependant.
Text is the list to sort, can be any container of line or comma-delimited list. The XFCN automatically recognizes the input separator, thus freeing of another unneeded parameter.
"l=" defines a non-standard line separator, ie different than comma, return or space that are automaticly recognized. Old param "s=" is still valid.
<sep> can be any character or one of the constants : space, return, tab, quote.
"i=" defines a non-standard item separator, ie different than comma. If not supplied, FullSort uses the ItemDelimiter property of HC 2.0 to get it.
<sep> can be any character or one of the constants : space, return, tab, quote.
"t=" determines the sort type, and can be followed by any word beginning with a, n, d or i. With these chars, items or lines will be sorted by :
A[scii] : ASCII code (this is the default type)
N[umber]   : real value of any embedded number
D[ate] : value of any embedded date MM/JJ/YY
T[ime] : value of any embedded time HH:MM
I[ntl]  : international code, thus recognizing diacritical marks
U[ppercase] : not case-sensitive sort
With N or D, the sort key can be preceeded or followed by any text, the XFCN is able to localize it anywhere in the string. If no sort key is present, the string will be placed at the end of the sorted list.
"d=" determines the sort direction, and can be followed by any word beginning with a, d, r or l. With these, items or lines will be sorted in :
A[scending] order (this is the default direction)
D[escending] order
R[andom] order
L[ist] order
L is the option allowing to co-sort any number of containers using the sort order of the first sort (see list parameter).
"c=" determines the sort key chunk, and can be followed by
"char x", "word x", "item x"
or "char x to y", "word x to y", "item x to y"
or "char x to *", "word x to *", "item x to *"
x being the starting chunk number in the item, y the ending chunk number. Using "*" for y will use the whole ending part of the item, starting at chunk x, as sort key.
Using this powerful parameter, sorting is allowed on virtually any part of the string.
Last parameter is useful only when "d=l", allowing to define its own sort order, and must be a comma-separated list of positive integers. In this case, the sort is done accomoding the defined list, and doesn't use any comparison value anymore. By default, the XFCN tries to use the global variable FullSortList returned by any preceeding sort. In this way, any succeeding sort respects the same sort order.
Using "!", "?" and "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The XFCN returns the sorted list of lines or items, and sets a global variable FullSortList with a comma-separated list of the resulting sorting order. Using "d=l" parameter in following calls with no list will use this global variable, and allow to co-sort any other container.
If an error occurs, the XFCN can return :
"Error : "c=" param must be followed by [char,word,item]"
"Error : "c=item" cannot be used with item sorting"
"Error : "c=xxxx " must be followed by a positive integer"
"Error : "c=xxxx" must be followed by a space"
"Error : Bad item x in Sort list"
"Error : Char following "d=" must be [a,d,r,l]"
"Error : Char following "t=" must be [a,n,d,i,u]"
"Error : Couln't get INTL resource"
"Error : First char of param 2..n must be [t,d,c,s]"
"Error : Missing Sort list parameter"
"Error : Missing input parameter"
"Error : Out of memory"
"Error : Second char of param 2..n must be "=""
"Error : Sort chunk param defined twice"
"Error : Sort direction param defined twice"
"Error : Sort type param defined twice"
"Error : "x" defined twice in Sort list"
"Error : Stop chunk must be greater that start chunk"
VERSIONS HISTORY
-----------------
3.2 : 06/29/92
ΓÇó Date & time sorting 35% faster !
3.1 : 05/17/92
ΓÇó Fixed again itemDelimiter handling
3.0 : 04/27/92
ΓÇó Fixed itemDelimiter/HC 2.0v2 bug
2.9 : 03/07/92
ΓÇó Enhanced separators handling
2.8 : 02/23/92
ΓÇó Added item delimiter param
2.7 : 03/17/91
ΓÇó Fixed time sorting bug arising with "12:xx am"
2.6 : 03/10/91
ΓÇó Fixed time sorting bug arising with "12:xx pm"
2.5 :
ΓÇó FullSortList is no more cleared when co-sorting and input list is empty
2.4 :
ΓÇó Fixed bug arising with unusual separator ASCII > 128
ΓÇó Fixed out of memory bug with list sort of large lists
2.3 :
ΓÇó Fixed bug arising with large sorting lists
2.2 :
ΓÇó Fixed word parsing procedure
2.1 :
ΓÇó Fixed random memory bug
2.0 :
ΓÇó New, quicker sort algorythm :
2 times faster with Ascii or International sort
3 times faster with Numeric sort
30 times faster Date sort !
ΓÇó The sort is now conservative, and keeps the previous order for chunks not used as sort key or unsorted items.
ΓÇó Added Uppercase sort ("t=u") to have a not case sensitive sort
ΓÇó Added Time sort ("t=t")
ΓÇó Added true chunk sorting. Now "c=chunk X" or "c=chunk X to Y" allowed
ΓÇó Unsorted items are now always at the end of the sorted list
• Added a separator param ("s=…") allowing to define non-standard item separator
(ie other that comma or return).
1.4 :
ΓÇó XFCN is more compact
ΓÇó sort doesn't anymore consume memory
ΓÇó co-sorted containers may have any number of entries
ΓÇó empty entries are preserved
1.3 :
ΓÇó items or lines of text with less chunks than specified by "c=..." are now placed at the end of the sorted list, whereas it returned an error before.
ΓÇó sort with "d=l" is now correct, even if the number of items of the sort list is less than the number of lines or items of text.
1.2 :
ΓÇó fixed a bug arising with empty lines or items at the beginning or end of the text.
1.1 :
ΓÇó FullSortList global is now correct after a descending sort.
</text>
</content>
<name></name>
<script></script>
</card>
card_21975.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<field descriptor> is a litteral string containing any valid field descriptor. Don't forget to enclose it in quotes, in order for it not to be interpreted by HyperCard when the XCMD is called. If you want to use the field name, you will use :
The XCMD creates a global variable named </span><span class="style6">FullTextHandle</span><span class="style1"> that contains the value of the temporary styled text handle stored in memory.
</span><span class="style7"> Don't change its value by yourself, or you will crash your Mac.</span><span class="style8">
</span><span class="style1">
Meanwhile, you can test its content to know if you're ready to use SetFullText, it should be Γëá empty in this case.
<field descriptor> is a litteral string containing any valid field descriptor. Don't forget to enclose it in quotes, in order for it not to be interpreted by HyperCard when the XCMD is called. If you want to use the field name, you will use :
The XCMD uses the global variable named </span><span class="style6">FullTextHandle</span><span class="style1">, previsouly created by GetFullTExt and that contains the value of the temporary styled text handle stored in memory.
</span><span class="style7"> Don't change its value by yourself, or you will crash your Mac.</span><span class="style8">
</span><span class="style1">
Meanwhile, you can test its content to know if you're ready to use SetFullText, it should be Γëá empty in this case.
This global variable and the styled text handle are purged from memory by SetFullText. So each call to SetFullText must be preceeded by GetFullText.
</span><span class="style4">ERRORS
</span><span class="style1">If an error occurs, SetFullText can return :
"Error : Param is not a field descriptor"
"Error : Field not found"
"Error : SetFullText works only with HC 2.0"
"Error : Missing parameter"
"Error : Must first use GetFullText"
"Error : Couldn't set destination field"
"Error : Couldn't empty FullTextHandle global"
</span></text>
</content>
<name>FullText 1.0</name>
<script>
on opencard
end opencard
on closeCard
hide cd fld 2
put empty into cd fld 2
end closeCard
</script>
</card>
card_23541.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
GetDir is an XFCN that gets the content of any volume of folder. Its numerous options allow to select precisely the needed information, and to choose the resulting values and their order.
As usual, using "!" and "?" returns online help (resp. about and syntax).
"pathName" is a string giving the pathname of the folder to explore. It cans end, or not, with a colon.
"mode" is a one or two characters string giving the items type to extract and the scanning mode (recursive or not).The first char can be"F" (Files), "D" (Directories) or "A" (All). Its default value is "A". The second char, if present, must be "+", and will tell the XFCN to look into all subfolders starting from the choosen folder.
"filter" is a logical expression setting a conditional filter to extract only some items of the choosen type. Many filters can be combined within the XFCN call, and are then logical-AND linked.
Each filter is "XΓÇóValue" shaped,ΓÇó being a logical operator among (in brackets , meaning when X is n) :
= : is (contains)
Γëá : is not (doesn't contain)
< : less than (begins with)
> : more than (ends with)
≥ : more or equal as (matches)
Γëñ : less or equal as (doesn't match)
And the filters can be :
"cΓÇóXXXX" : filter by file Creator (files only).
XXXX is a 4 chars case sensitive string.
"dΓÇóN" : filter by Data fork size (files only).
N is a positive integer.
"eΓÇóDATE" : filter by crEation date.
DATE is a date string, understanding '/', '-' or '.' as
separator.
"fΓÇóN" : filter by number of files (Folders only).
The function returns a return separated list of files and/or folders. Each line is composed by comma separated informations, as defined and ordered by "o=..." filter. If no Output mask is given, the only name will be returned.
Current disk search can be stopped by typing Cmd-. Cmd-: or Escape.
GetDir follows international resources, this for dates or foreign characters and in input as well as in output.
This XFCN will not hang with null-starting file names, and will replace all these CHR(0) by CHR(1) in output.
If an error occurs, a string beginning with "Error :" will be returned. This string can take the following values :
"Error : Not a valid date"
"Error : Couln't get INTL resource"
"Error : First char of filter param must be [c,d,e,f,l,m,n,o,r,s,t,x,y]"
"Error : Second char of filter param must be [=,≠,>,<,≥,≤]"
"Error : Missing comparison value for "XΓÇó" test"
"Error : Bad file creator"
"Error : Only "o=…" allowed"
"Error : "x" not allowed in output mask"
"Error : Bad file type"
"Error : Missing pathName"
"Error : Volume not found"
"Error : Directory not found"
"Error : Not a directory"
RELEASES HISTORY
-----------------
1.8
ΓÇó Added searching interruption feature
ΓÇó Added "=" param for online help
1.7
ΓÇó Comma replaced by colon if output mask has many items
1.6
ΓÇó CHR(0) are also replaced in file type & creator
1.5
ΓÇó Only CHR(0) are now replaced by CHR(255) in file name
1.4
ΓÇó Mofidied S filter and output to match physical size
ΓÇó Added L filter and output for logical size
ΓÇó Logical and physical size now allowed for folders
ΓÇó Fixed a bug of directory testing
1.3
ΓÇó Added file version number for output mask
ΓÇó Added creation and modification time for filters and output mask
</text>
</content>
<content>
<layer>card</layer>
<id>28</id>
<text>telecom</text>
</content>
<content>
<layer>card</layer>
<id>60</id>
<text>XCEL</text>
</content>
<content>
<layer>card</layer>
<id>67</id>
<text>88888</text>
</content>
<content>
<layer>card</layer>
<id>68</id>
<text>12/12/89</text>
</content>
<content>
<layer>card</layer>
<id>92</id>
<text>desk</text>
</content>
<content>
<layer>card</layer>
<id>99</id>
<text>0</text>
</content>
<content>
<layer>card</layer>
<id>75</id>
<text>0</text>
</content>
<content>
<layer>card</layer>
<id>82</id>
<text>12/12/89</text>
</content>
<content>
<layer>card</layer>
<id>98</id>
<text>0</text>
</content>
<content>
<layer>card</layer>
<id>100</id>
<text>APPL</text>
</content>
<content>
<layer>card</layer>
<id>119</id>
<text>Desktop DB,40960,12/8/91
Desktop DF,131072,12/7/91
Desktop Folder:,1601536,12/7/91
ALL.FILES,68096,11/18/91
Downloads:,460288,12/8/91
299.12/4,58368,12/5/91
300.12/5,53760,12/6/91
301.12/6,32768,12/6/91
BinHqx 1.02 alias,1024,11/26/91
Colorize 3.00 ƒ:,13824,12/7/91
Colorize 3.0 Doc,512,5/11/91
Colorize 3.00,13312,3/24/91
CptExpand alias,1024,11/26/91
DDExpandΓäó alias,1024,11/26/91
DownLine alias,1024,12/2/91
DownLine Bad Files:,7168,12/8/91
1.headers,2560,12/7/91
2.headers,1536,12/8/91
3.headers,1536,12/8/91
headers,1536,12/7/91
Flush,96256,12/8/91
ftp.list.Winter91,38400,12/7/91
LPunch Decoder 1.1 alias,1024,11/26/91
Ode to Joy,47616,12/8/91
pop files,77312,12/8/91
SitExpand alias,1024,11/26/91
UnStuffIt DeluxeΓäó alias,1024,11/26/91
WPs for Thesis,27648,12/8/91
Foyer ƒ:,975360,12/8/91
CarolStack,168960,12/8/91
CNS Shipper.dd,226304,12/7/91
Macintosh Memory Guide,61440,9/16/91
ΓÇóDOM:,514048,12/7/91
Christmas beeps.dd,287232,12/7/91
XMas.GIF.dd,226816,12/7/91
ΓÇótofix,4608,11/25/91
RECENT.FILES #1,10240,12/7/91
XMACARCH.all files,75264,11/18/91
XMACARCH.RECENT #1,12288,12/7/91
Icon
,2048,11/3/91
System Folder:,593920,11/3/91
Clipboard File,1024,8/26/88
Finder,109568,10/9/90
General,14336,3/7/90
Monitors,40448,9/4/90
Silver Init,23552,6/5/91
Startup Device,2560,8/26/88
System,402432,6/1/91
Trash:,0,12/8/91
ΓÇóDisinfectant 2.5.1,190976,7/7/91
</text>
</content>
<name>GetDir 1.8</name>
<script>on RadioUpdate Start,Stop
get number of the target
if (it > 3) and (hilite of btn it)
then set hilite of btn it to false
else
repeat with i=Start to Stop
do "set hilite of btn i to (i=it)"
end repeat
if it > 3
then select text of cd fld (((it-4) div 6) + 3)
end if
end RadioUpdate
on opencard
end opencard
on closeCard
hide cd fld 12
hide btn 58
end closeCard
</script>
</card>
card_24896.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
GetFInfo is an XFCN returning a list of Finder informations for a file.
SYNTAX
-------
GetFileInfo <file path or name>[,"DontResolveAlias"]
PARAMETERS
------------
<file path or name> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
"dontResolveAlias" allows to deal with an alias file itself (System 7.0 only) rather than with the file pointed by it.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The returned list contains the following 23 items :
1) type
2) creator
3) creation date (short format)
4) creation time
5) modification date (short format)
6) modification time
7) total size in bytes
8) data fork size in bytes
9) resource fork size in bytes
then 16 booleans values corresponding to the file flags (depending on System version):
GetMode is an XFCN allowing to get the screen(s)' video mode and depth.
SYNTAX
-------
GetMode ( )
PARAMETERS
------------
No parameter needed, but using "!" and "?" parameter will return an online help (resp. copyright and syntax).
USING
-----
The XFCN returns a one or many lines string, each one corresponding to one available screen. Each line contains a 5 or 7 items (depending on the System in use) :
GetPassword is a XFCN allowing to type a hidden password in a dialog.
SYNTAX
-------
GetPassword ([<prompt>])
PARAMETERS
------------
Prompt is a string that will appear in the dialog. Default value is :
"Please enter password :"
Using "!" and "?" parameter will return an online help (resp. copyright and syntax).
USING
-----
The returned value is an integer value corresponding to the encrypted input. The dialog is centered on the card, and typing is hidden with bullets in it.
Almost one char must be typed before validating. An empty string is returned if cancelled.
If an error occurs, this value can be :
"Error : Ask dialog not found"
HISTORY
--------
1.3 : 09/09/91
ΓÇó Fixed to be SuperCard compatible
1.1 :
ΓÇó Use notification manager for HC 2.0
</text>
</content>
<name>GetPassword 1.3</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_26518.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
GlobalList returns the list of available global variables.
SYNTAX
--------
GlobalList([<ListAll>])
PARAMETERS
------------
<ListAll> is a boolean, making the returned list contain all global variables available (TRUE), or only those not handled by HyperCard or the Home stack (FALSE). Default is FALSE.
Using "!" and "?" as parameter will return an online help (resp. copyright and syntax).
USING
-----
The XFCN return an itels delimited list of variable names.
If an error occurs, GlobalList can return :
"Error : Out of Memory"
"Error : Parameter must be true or false"
VERSIONS
---------
1.1 :
ΓÇó Fixed returned value when no globals are defined
</text>
</content>
<name>GlobalList 1.1</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_27500.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<file pathname> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
<type 1[…,type N]> is an item list of types for which the ICN# has to be got. If empty, the main ICN# is copied.
<dest file> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack. If omited, the destination will be the current stack.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The XCMD return in the Result an item list of copied ICON(s) IDs. An empty item in it means that the corresponding type in type list parameter was not found in the file, or that its ICN# was missing.
The copied ICON(s) are automatically named by catenating the Creator of file and Type for each.
If an error occurs, ICNToICON can return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : XXXX entries not found in BNDL"
"Error : Missing or empty file name"
"Error : Could't open prov file"
"Error : Couln't get BNDL resource"
"Error : Found no FREF resource"
"Error : Bad file type in list"
"Error : AddResource failed"
"Error : WriteResource failed"
"Error : UpdateResFile failed"
HISTORY
-------
1.6 : 08/04/91
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "=" param for online help
1.5:
ΓÇó BNDL access change to handle particular files.
1.4 :
ΓÇó fixed a bug arising whith files having an icorrect BNDL resource
This stack uses FilePath XFCN (© 1898, 1990 Apple Computer, Inc.) and DocTypes XFCN (© Frédéric RINALDI).
</text>
</content>
<name>ICNToICON 1.6</name>
<script></script>
</card>
card_28613.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
IsFile is a XFCN allowing to test the existence of a file on a volume.
SYNTAX
-------
IsFile (<file name or pathName>)
PARAMETERS
------------
The parameter can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
Using "!" and "?" as parameter will return an online help (resp. copyright and syntax).
USING
-----
The XFCN returns "true" if the file exists, "false" if not.
If an error occurs, it can return :
"Error : Volume not found"
"Error : Bad Name"
"Error : Directory not found"
"Error : I/O Error"
"Error : Unknown #xx"
"Error : Missing parameter"
</text>
</content>
<name>IsFile 1.0</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_29646.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
IsFinderLocked XFCN allows to know if a file is locked or not (Finder info ckeckbox).
SYNTAX
--------
IsFinderLocked <file path or name>[,"DontResolveAlias"]
PARAMETERS
------------
<file path or name> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
"dontResolveAlias" allows to deal with an alias file itself (System 7.0 only) rather than with the file pointed by it.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
If an error occurs, IsFinderLocked can return :
"Error : Not a file
"Error : Not a folder
"Error : Alias file not supported
"Error : Volume not found
"Error : Bad Name
"Error : File not found
"Error : Folder not found
"Error : File is busy
"Error : I/O Error
"Error : Folder is full
"Error : Volume is locked
"Error : No resource fork
"Error : Duplicate file/folder name
"Error : Moving whole volume not allowed
"Error : Not an AppleShare volume
"Error : AppleShare insufficient privileges
"Error : Missing or empty parameter"
"Error : Second param can only be "DontResolveAlias""
HISTORY
-------
1.1 :
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "=" param for online help
This stack uses FilePath XFCN (© 1898, 1990 Apple Computer, Inc.)
</text>
</content>
<name>IsFinderLocked 1.1</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_30174.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
Only first param is needed. Order of params 3 to 12 doesn't matter, since the XCMD is able to recognize them.
</span><span class="style3">WName</span><span class="style1"> is a string giving the windoid name. Many windoids can be opened by using different names.
</span><span class="style3">List</span><span class="style1"> is a return or comma delimited string that will be displayed. Listoid provides an automatic separator recognition.
</span><span class="style3">WStyle</span><span class="style1"> is a string defining the window style. Allowed styles are : plain, zoom, roundRect, rect, shadow, windoid, windoidZoom, bigWindoid, bigWindoidZoom, Rinaldoid, RinaldoidZoom (Rinaldoid is the same as windoid, except that it displays the window title). All window styles are floating, except plain, zoom and roundRect. A windoid or Rinaldoid style window will have small scrollbars, while other styles will use standard size. Default is RinaldoidZoom if Rinaldoid WDEF resource is present, windoidZoom if not found.
</span><span class="style3">X,Y[,Z,T]</span><span class="style1"> will be a point or a rect, and will define position and/or size of the windoid. Coordinated are card-relative. If omitted, windoid will appear with standard size at "0,10".
</span><span class="style3">NO|ONE|CON|DIS</span><span class="style1"> defines the selection mode (no selection, one at a time, may but adjacent, many disjoint). Default is ONE.
</span><span class="style3">selected line(s)</span><span class="style1"> is an integer or a comma separated list of integers. It defines the selected line(s) when the windoid appears. Default is 1, but 0 can be used to have no selection at start.
</span><span class="style3">fontName[,size]</span><span class="style1"> is the name of font and its size to use. Default is Geneva 10.
</span><span class="style3">separator</span><span class="style1"> is a single char allowing to specify a non-standard (Γëá comma or return) delimiter char.
</span><span class="style3">prompt</span><span class="style1"> is a message string which will appear in the windoid right over the list. If omitted, the list will fill the whole windoid.
</span><span class="style3">alignment</span><span class="style1"> defines the text alignment in the list. It can be "left", "right" or "center". Default is left.
</span><span class="style3">Color</span><span class="style1"> is a one or two items string giving the foreground and background color. For each item, allowed values are the standard colors (black, white, blue, red, yellow, cyan, magenta, green), or a three word string corresponding to red, green and blue values (100 5624 28652). Default is "black,white".
</span><span class="style3">DontAllowReorg</span><span class="style1"> allows to deactivate the list reorganizing feature whith Option key held down (default is activated).
Using "!", "?" and "=" as first parameter will return an online help (resp. copyright, syntax and output).
Listoid is stand alone, no linked resource is needed. Meanwhile, this stack contains a WDEF and a CDEF resource that are recognized by the XCMD if present. The WDEF allows to have an enhanced windoid-type window displaying title, while the CDEF is useful to get nice-looking scroll arrows for small scroll bars. So, these resources are optional, and for aesthetic purpose only. If you copy them, their ID can be set to any value but don't change their name.
the card script contains a "on keyDown" handler that allows selection of first matching item when typing a key in conjunction with option key. Moreover, while holding the option key down, the arrow keys allow to move in the list, return or enter to simulate a double-clic.
It is now possible to send any string to search for to the window using :
</span><span class="style5"> send "string" to window <WName></span><span class="style1">
If the string is found, it will be highlighted int the list. Look for "on keyDown" handler in the card script, type option+Key to try it.
Holding the optionKey when clicking on selected item(s) will allow list reorganization. Just drag the outlined cells over the list, and all of them will be moved right where the black line appears. Releasing the optionKey at any moment cancels the current move.
in order to avoid HyperCard's confusion, existing quotes (") in WName param are automatically changed to single quote (').
</span><span class="style3">listoidSelect</span><span class="style1"> : sent when Double-clicking on item(s) in the list, followed by the clicked word(s) and the Listoid name and ID (the latter only with HC 2.1). This message can be trapped using a handler :
</span><span class="style5"> on ListoidSelect What,WName,WID
if WName is "MyList" and What is ...
end ListoidSelect
</span><span class="style1">
</span><span class="style3">openListoid</span><span class="style1"> : sent when a windoid is opened, followed by the windoid name and ID (the latter only with HC 2.1). This allows to define window properties before it is shown, since the message can be trapped using a handler :
</span><span class="style5"> on openListoid WName,WID
if WName is "MyWindow" then...
end openListoid
</span><span class="style1">
</span><span class="style3">closeListoid</span><span class="style1"> : sent when a windoid is closed, followed by the windoid name and ID (the latter only with HC 2.1). This message can be trapped using a handler :
</span><span class="style5"> on closeListoid WName,WID
if WName is "MyWindow" then...
end closeListoid
</span><span class="style1">
</span><span class="style3">clickInListoid</span><span class="style1"> : sent when clicking and releaseing button in the windoid (mouseUp), followed by the Listoid name and ID (the latter only with HC 2.1). This message can be trapped using a handler :
</span><span class="style5"> on clickInListoid WName,WID
if WName is "MyList"...
end clickInListoid
</span><span class="style1">
</span><span class="style3">clickInPrompt</span><span class="style1"> : sent when clicking on the prompt if any (mouseDown), followed by the Listoid name and ID (the latter only with HC 2.1). This message can be trapped using a handler :
</span><span class="style5"> on clickInPrompt WName,WID
if WName is "MyList"...
end clickInPrompt
</span><span class="style1">
</span><span class="style4">PROPERTIES
</span><span class="style1">
Like any XWindow, Listoid has properties that can be get and set thru HyperTalk.
</span><span class="style5"> properties of window "Infoid"
</span><span class="style1">
will return an item list of all allowed properties :
ΓÇó loc : windoid's position according to card
ΓÇó visible : windoid's visibility
ΓÇó text : windoid's text
ΓÇó rect : windoid's position and size according to card
When using the "set text" property, the XCMD scans again the input text to find any new separator used, except if this one has been forced in the parameters of the original call.
put "get ListSelect (" & inQ(cd fld 1) & ",cd fld 2" into Cmd
repeat with i=3 to 7
if hilite of btn i
then
if cd fld i is in "return,tab,linefeed,formfeed"
then put "," & cd fld i after Cmd
else put "," & inQ(cd fld i) after Cmd
end if
end repeat
put ")" after Cmd
put cmd
do Cmd
put it into cd fld 8
put ListSelectExit into cd fld "Exit"
end mouseUp
function inQ what
return quote & what & quote
end inQ</script>
</part>
<part>
<id>8</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <false /> </lockText>
<rect>
<left>51</left>
<top>256</top>
<right>91</right>
<bottom>271</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>9</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <false /> </lockText>
<rect>
<left>92</left>
<top>256</top>
<right>180</right>
<bottom>342</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>10</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <false /> </lockText>
<rect>
<left>181</left>
<top>256</top>
<right>238</right>
<bottom>271</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>11</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <false /> </lockText>
<rect>
<left>242</left>
<top>256</top>
<right>299</right>
<bottom>271</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>12</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <false /> </lockText>
<rect>
<left>303</left>
<top>256</top>
<right>360</right>
<bottom>271</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>13</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <false /> </lockText>
<rect>
<left>364</left>
<top>256</top>
<right>421</right>
<bottom>271</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>14</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <true /> </autoTab>
<lockText> <false /> </lockText>
<rect>
<left>425</left>
<top>256</top>
<right>482</right>
<bottom>271</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>15</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>353</left>
<top>290</top>
<right>492</right>
<bottom>342</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>1</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>69</left>
<top>68</top>
<right>434</right>
<bottom>252</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>22</id>
<type>button</type>
<visible> <false /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>0</left>
<top>326</top>
<right>18</right>
<bottom>342</bottom>
</rect>
<style>checkbox</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script></script>
</part>
<part>
<id>17</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>200</left>
<top>272</top>
<right>218</right>
<bottom>288</bottom>
</rect>
<style>checkbox</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script></script>
</part>
<part>
<id>18</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>262</left>
<top>272</top>
<right>280</right>
<bottom>288</bottom>
</rect>
<style>checkbox</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script></script>
</part>
<part>
<id>19</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>323</left>
<top>272</top>
<right>341</right>
<bottom>288</bottom>
</rect>
<style>checkbox</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script></script>
</part>
<part>
<id>20</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>385</left>
<top>272</top>
<right>403</right>
<bottom>288</bottom>
</rect>
<style>checkbox</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script></script>
</part>
<part>
<id>21</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>447</left>
<top>272</top>
<right>465</right>
<bottom>288</bottom>
</rect>
<style>checkbox</style>
<showName> <false /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name></name>
<script></script>
</part>
<part>
<id>23</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>185</left>
<top>308</top>
<right>345</right>
<bottom>326</bottom>
</rect>
<style>roundrect</style>
<showName> <true /> </showName>
<highlight> <false /> </highlight>
<autoHighlight> <true /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>Automatic Demo</name>
<script>on mouseUp
global ListSelectExit
put ListSelect("DIS",cd fld 2,"Geneva,9") into cd fld 8
put ListSelectExit into cd fld "Exit"
put ListSelect("1#","Here is a much longer string than before"&¬
return&cd fld 2,"Selet item :",return,"My Button") into cd fld 8
put ListSelectExit into cd fld "Exit"
put ListSelect("*CON",cd fld 2,"Select the item you want from the list :"¬
,"OK","","0,0","Monaco") into cd fld 8
put ListSelectExit into cd fld "Exit"
put ListSelect("*3#",cd fld 2,empty,return,"50,50,100,292",empty)¬
into cd fld 8
put ListSelectExit into cd fld "Exit"
put ListSelect("ONE",cd fld 2,"User dialog",600) into cd fld 8
put ListSelectExit into cd fld "Exit"
put ListSelect("DIS#",cd fld 2,"Hello","100,150,101,151",empty,empty)¬
into cd fld 8
put ListSelectExit into cd fld "Exit"
put ListSelect(3,cd fld 2,empty,"400,0,512,342") into cd fld 8
put ListSelectExit into cd fld "Exit"
end mouseUp
</script>
</part>
<part>
<id>24</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>202</left>
<top>329</top>
<right>332</right>
<bottom>342</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name>Exit</name>
<script></script>
</part>
<content>
<layer>card</layer>
<id>1</id>
<text>
ListSelect 4.1
by Frédéric RINALDI
DESCRIPTION
------------
ListSelect is an XFCN allowing to choose one or many items within a list appearing in a dialog on the screen. The XFCN is stand-alone, meaning that no extra resources (DLOG or DITL) are needed, but it can use personnalized resources created by the user.
Many powerful caracteristics make it the developer's best friend :
ΓÇó 4 times quicker than DoList
ΓÇó The input list can be a comma or return separated list, without need to tell it to the XFCN
ΓÇó Allows to select an item by typing its first letter on the keyboard
ΓÇó Dialog's Font and Fontsize can be choosen
ΓÇó Sorted diplayed list on demand
ΓÇó Selection can be unique, multiple continuous ou multiple discontinuous
ΓÇó The output can return item names or numbers
ΓÇó The output list separator can be any char (comma, return, etc.)
ΓÇó Buttons' name can be modified by parameter passing
ΓÇó One ot both buttons can be hidden
ΓÇó Uses up and down arrows for moving
ΓÇó Allows multiple selection with Command + up and down arrows
ΓÇó Accepts Escape or Commande-Z to cancel, Enter, Return or double click to validate
ΓÇó Accepts Command-A to select all
ΓÇó Option + up or down arrow selects teh first or last list's element
ΓÇó The order of parameters 3 to 8 doesn't matter
ΓÇó Error messages are plenty and meaningful
Moreover, if you use automatic dialog creation :
ΓÇó The dialog's width is automatically adjusted to the longest list's element
(except if you define a new bound rectangle)
ΓÇó The prompt message is optional, and its place in the dialog is recovered by the list if you leave it empty
ΓÇó The prompt message can be of any length, the statText item is automati-cally adjusted
ΓÇó If both buttons are hidden, their place is recovered too
ΓÇó If only one button is hidden, the other is automatically centered
ΓÇó Dialog's default positionning is centered on the card window, but you can set it at any location
ΓÇó Dialog's rectangle can be defined exactly
ΓÇó Buttons are automatically superposed if the dialog isn't width enough to hold then juxtaposed
ΓÇó If the user defined rectangle is too small, defaut minimum rectangle is used
If mode is preceeded by "*" char, the list will be sorted before diaplayed.
If mode is followed by "#" char, the output list will contain items' numbers,
and not their names. Remark that a sorted list returns item numbers of previous list's organization, so that you always can refer to it.
List
Any return or comma delimited list container.
s=#[,#]
An item string allowing to define the selected lines when the dialog pops. The list must be preceeded bty "s=". Default is 1. Ex : "s=2,5"
NoDoubleClick
With this param, the double-click in the list will have no action.
Prompt, OK and Cancel
Any string, an empty string will hide the corresponding item in the dialog.
Loc|Rect
X,Y are integer expressed in pixels corresponding to the topleft corner of the dialog
or
X,Y,X',Y' are integer expressed in pixels corresponding to the topleft and bottomright corners of the dialog. With an user dialog, only X and Y will be used.
Sep
Any character (return, tab, ",", etc.). The default one is comma.
DLOG ID
Identifier of the DLOG resource created by the user, and following exactly these rules:
- minimum 4 items in the dialog
- Item #1 = validation button
- Item #2 = cancel button
- Item #3 = statText containing "^0"
- Item #4 = UserItem which size will define the list's size. Its height
must be a multiple of the choosen Font's textHeight.
Font[,Size]
A string corresponding to an existing Font name. A second item in this string allows to set the desired Font size.
Using "!", "?" and "=" as parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The XFCN return an item or an item list corresponding to the dialog's selection. This list will contain either names of items, either their numbers.
Default item separator is Comma, but anything else can be choosen by call.
It is possible to know the way the user leaved the dialog by testing the global variable ListSelectExit set by the XFCN. This one will contain the name of the button used to leave (or "tabKey" if the user typed it). This is particularly useful when using resource DLOG, any additional active button item beeing manageable from the script.
If an error occurs, the ListSelect() will return :
"Error : Bad Rectangle Parameter 1"
"Error : Bad Rectangle Parameter 2"
"Error : Bad Rectangle Parameter 3"
"Error : Bad Rectangle Parameter 4"
"Error : Missing Parameter(s)"
"Error : Bad Mode Parameter"
"Error : Bad Font size"
"Error : Couldn't find DLOG Resource"
"Error : Missing DITL Item(s)"
"Error : Item #1 must be a button"
"Error : Item #2 must be a button"
"Error : Item #3 must be a statText"
"Error : Item #4 must be a userItem"
"Error : Out of memory"
TEST
-----
Fill the different parameter fields below, and check the corresponding checkboxes if you want to use it.
MacType is a XFCN that returns the Macintosh environment (including IIci, IIfx and Portable). And believe me, this one will be upgraded when new products will arise.
SYNTAX
-------
MacType ( )
PARAMETER
-----------
No parameter is needed. Meanwhile, standard help param "!", "?" and "=" can be passed to get online help (resp. copyright, syntax and output).
USING
-----
The XFCN return a 6 items string, being respectively :
Special thanks to Eric Ruff for his faithfully beta-testing.
Menu 2.1 is the evolution of the well known MenuSet package. Plenty of enhancements have been added, in order to make Menu XCMD the most powerful and easy to use menu external ever used.
Major enhancements are :
ΓÇó The whole set has been compiled in just one XCMD of 16 Kb (26 Kb for 11
externals before).
ΓÇó Each item or subitem name is now parsed, in order to remove special
formatting codes. Thus, "<B^257Item!√" is same as "item" for the XCMD.
ΓÇó Special formatting codes can be used in any command parameter.
ΓÇó Menu, item, subitem names and Command chars are automatically
capitalized to preserve Human Interface Guidelines
ΓÇó The syntax has been homogenized in all commands :
Menu <command>,<menu>,<item>,<subitem>
and when an additional param is needed, it is always in second place :
Menu <command>,<special>,<menu>,<item>,<subitem>
So, you need now to specify the whole path for a subitem, the XCMD
doesn't search anymore in menu, then submenu list of items. This allows
now to have many identical subitems in a same menu.
ΓÇó For any item or subitem param, you can use either its name, or its number.
ΓÇó Everything has been forecast to prevent suppression of user File menu or
of its Quit item, and any modification out of guidelines of this item.
ΓÇó Install can now even install the File menu. In this case, it will add all the
supplied items before the quit item.
ΓÇó Switch accepts now About and Help items that go under the Apple menu.
ΓÇó Many commands have been added to deal with item command, style, ICON or even SICN.
ΓÇó Extensive online help is available (you have to get the Result after calling to obtain the help text) :
typing Menu "!"
will return "Version 2.1, © Frederic RINALDI 1989,1990,1991"
Typing Menu "?"
will return "Type ΓÇ£Menu "?",<command>ΓÇ¥ to get help on a command"
Typing Menu "?",<command>
will return syntax help for that command.
Typing Menu "="
will return "<error> if any OR <ICON|SICN id> OR <styles list> OR <
shortcut char> OR <menus count>"
ΓÇó When "*" is allowed anywhere in the syntax, it means either "all" most of the time, or "end" for Insert command.
ΓÇó The menu definition can now use either return or semi-colon as separator.
ΓÇó A special hack has been provided to allow SICN inserting using special
formatting chars (like ^xxx for an ICON).
ΓÇó Menu is fully international, giving the right "File" and "Quit" name when you call Switch.
And, like for MenuSet 1.0 :
ΓÇó Menu 2.1 remains the only XCMD allowing to remove all HC menus
except Apple, File & Edit menu. The File menu is fully customizable, and
the Edit menu still allows Cut, Copy & Paste.
ΓÇó Even really powerful, it remains a simple to use as any HyperTalk
statement. You will never have to deal with dummy menu IDs stored in
global variables, just pass the names and it will do it for you.
ΓÇó Finally, like all of my externals, I will support it and regularly enhance it.
HOW TO USE IT
-------------
Global syntax of Menu XCMD is :
Menu <command> [<param 1>...,<param N>]
New, Menu, item and subitem parameters are always name strings, but you can even use a number for item (the order in menu) and subitem (the order in submenu). Any of these parameters, except Menu name can use the standard formatting chars recognized by the File Mgr, either at the beginning or at the end of the name string :
^XXX associates an ICON resource to the item
!X puts a mark before the item
<X sets the style of the item (B, I, O, U, S)
NOTE : a bug in the Menu Mgr prevents using <E (extend) and <C
(condense) in the string. Using one of these will cause the
item to be ignored. Rather use SetStyle (see later).
/X associates a command key to the item
( disables the item
and a special hack :
¨XXX associates an SICN resource to the item (¨ = option-u)
The first command parameter will determine the action of Menu XCMD :
SWITCH
Menu "Switch"[,<About item>[,<help item>]]
Hides all HC menus, leaving only the Apple, File & Edit menus. About & Help items will be placed under the Apple menu, File has only a Quit item and Edit keeps all working clipboard handling items.
Called for the first times, Switch hides the HC menus. Called a second time, it restores the original menuBar.
HINT : Whatever is the wording you choose for About item, HC 1.2.x sends doMenu "About HyperCard...". So do a correct test in your handler.
REMOVE
Menu "Remove",<menu|*>[,<item|*>[,<subitem|*>]]
Removes one or all menus, items of a menu or subitems of a submenu. "*" stands for all when used in place of any parameter.
INSTALL
Menu "Install",<menu def>[…,<menu def>]
Installs one or many (up to ten) user menus in one call. MenuDef can any container or literal string containing :
Changes the wording of any item or subitem. Using a comma separated list as new parameter, you can even add a submenu to any existing item, or with special formatting chars change its style, ICON, etc.
INSERT
Menu "Insert",<new>,<menu>,<before item|*>[,<before subitem|*>]
Inserts a new item in a menu or a new subitem in a submenu. If you use
"*" as a param, the new item will be inserted at the end.
CHECK/UNCHECK
Menu "Check",<menu>,<item|*>[,<subitem|*>]
Menu "Uncheck",<menu>,<item|*>[,<subitem|*>]
Checks or unchecks any item or subitem. "*" stands for all when used in place of any parameter, thus allowing to check all items in one call.
ENABLE/DISABLE
Menu "Enable",<menu>[,<item|*>[,<subitem|*>]]
Menu "Disable",<menu>[,<item|*>[,<subitem|*>]]
Enables or disables a whole menu, or any item or subitem. "*" stands for all when used in place of any parameter, thus allowing to set all items in one call.
FIND
Menu "Find",<item or subitem>
Allow to find in which menu/submenu is any item or subitem. You have to get the Result after calling to obtain a list of matching menus. Each line of the returned comma separated list contains a menu name, sometimes the submenu name and the number of the item in the menu or submenu..
LIST
Menu "List",<menu|*>[,<item|*>[,<*>]]
GetList returns a list of menus, items or subitems. Depending on the params you pass, List wiil return :
Menu "List","*" ........................... comma separated list of menu names
Menu "List","menu"....................... menuDef of menu (see Install)
Menu "List","menu","*"................ list of items & subitems of menu
Menu "List","menu","item"............ item & list of subitems of submenu
Menu "List","menu","item","*"..... list of subitems of submenu
You have to get the Result after calling to obtain the required list.
HINT : if the first item of the returned menus list is "File", then you already called Switch command.
COUNT
Menu "Count",<menu|*>[,<item|*>[,<*>]]
Count returns the number of user menus, items in a menu or subitems in a submenu. Last param must always be "*". You have to get the Result after calling to obtain the resulting number.
If you ask for the number of menus after have called Switch, the File user menu will be one of the totalized menus.
ISCHECKED/ISENABLED
Menu "IsChecked",<menu>,<item>[,<subitem>]
Menu "IsEnabled",<menu>[,<item>[,<subitem>]]
Returns "true" or "false", allowing to know if the menu, item or subitem is checked or enables. You have to get the Result after calling to obtain the value.
GETCMD/SETCMD
Menu "GetCmd",<menu>,<item>[,<subitem>]
Menu "SetCmd",<Cmd char>,<menu>,<item>[,<subitem>]
Returns or sets the command char of any item or subitem. You have to get the Result after calling GetCmd to obtain the cmd char.
GETICON/SETICON
Menu "GetIcon",<menu>,<item>[,<subitem>]
Menu "SetIcon",<ICON ID>,<menu>,<item>[,<subitem>]
Returns or sets the associated ICON of any item or subitem. ICON ID must be greater than 256 but smaller than 512. You have to get the Result after calling GetIcon to obtain the ICON ID.
GETSTYLE/SETSTYLE
Menu "GetStyle",<menu>,<item>[,<subitem>]
Menu "SetStyle",<style>,<menu>,<item>[,<subitem>]
Returns or sets the style of any item or subitem. You have to get the Result after calling GetStyle to obtain the style string.
Style is a one or many chars string which can contain :
N (Normal), B (Bold), I (Italic), U (Underline), O (Outline), S (Shadow),
C (Condense), E (Extend)
GETSICN/SETSICN
Menu "GetSicn",<menu>,<item>[,<subitem>]
Menu "SetSicn",<SICN ID>,<menu>,<item>[,<subitem>]
Returns or sets the associated SICN of any item or subitem. SICN ID must be greater than 256 but smaller than 512. You have to get the Result after calling GetSicn to obtain the SICN ID.
------------------
Finally, don't worry : the XCMD is really bullet-proof, and numerous errors strings are available in the Result when something goes wrong :
"Error : Menu not found"
"Error : Bad ICON or SICN ID (257 Γëñ x Γëñ 511)"
"Error : Item not found"
"Error : Subitem not found"
"Error : Missing parameter(s)"
"Error : Useless parameter(s)"
"Error : This item has no submenu"
"Error : File menu cannot be removed"
"Error : Quit item cannot be removed from File menu "
"Error : UserLevel must be ≥ 4"
"Error : Couldn't save current Edit menu"
"Error : No more than 10 user menus"
"Error : Bad menu name in param #x"
"Error : Must call Switch before installing File menu"
"Error : "*" not allowed in Change params"
"Error : No more than one subMenu level"
"Error : "*" not allowed in menu param for Insert"
"Error : "*" not allowed in menu param for Check/Uncheck"
"Error : Quit item of File menu cannot be checked"
"Error : Whole File menu cannot be disabled"
"Error : Quit item of File menu cannot be disabled"
"Error : Out of Memory"
"Error : "*" not allowed in IsEnabled params"
"Error : "*" not allowed in IsChecked params"
"Error : "*" not allowed in Get... params"
"Error : "*" not allowed in Set... params"
"Error : SetCmd not allowed for Quit items of File menu"
"Error : SetCmd not allowed for items having a submenu"
"Error : SetSicn not allowed for items having a submenu"
"Error : Unknown command"
"Error : Empty param #x"
"Error : File menu resource not found"
"Error : SubMenu not allowed for About item"
"Error : SubMenu not allowed for Help item"
"Error : Duplicate menu name"
HISTORY
-------
2.1 8/15/91
ΓÇó Locked parameter block for HC 2.0
ΓÇó Changed submenus IDs to be HC 2.0 compatible
ΓÇó Cleaned the code
ΓÇó Added "=" online help param
</text>
</content>
<name>Menu 2.1</name>
<script>on doMenu What
if What is in "Item 1,Item 2,Item 3"
then answer "You called menu ΓÇ£" & What & "ΓÇ¥"
else pass doMenu
end doMenu
on opencard
end opencard
on closeCard
end closeCard
on doMenu What
Menu "Find",What
if the Result Γëá empty
then
answer "This is a call to user menu “" & item 1 of the Result¬
& "ΓÇ¥"
else
Menu "List","*"
if first item of the Result is "File"
then
if What is "About HyperCard..."
then answer "This is a call for user About..."
else if What is "Help…"
then answer "This is a call for user" && What
else pass doMenu
else pass doMenu
end if
end doMenu
</script>
</card>
card_34723.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
NameNewFile provides a dialog allowing to name a new file and its destination (SFPutFile). Not anymore required with HC2.0 which includes this feature.
SYNTAX
-------
NameNewFile([<default name>[,<prompt>]])
PARAMETERS
------------
<default name> is the file default name.
<prompt> is the message appearing in the dialog.
Using "!", "?" and "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The XFCN returns the full pathame of named file.
An empty string is returned if the user clicked on Cancel.
Although working fine with both System 6 and System 7, FullSFPack is better suited for the latter, due in part to alias handling.
HISTORY
--------
1.0 17/07/92
ΓÇó First public release
</text>
</content>
<name></name>
<script></script>
</card>
card_35576.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
Notification allows to invoke the Notification Manager under Multifinder.
SYNTAX
--------
Notification
PARAMETERS
------------
Using "!" and "?" as parameter will return an online help (resp. copyright and syntax).
USING
-----
Must be used to alert the user when HyperCard is running in the background. Notification starts blinking a small HyperCard icon in place of the Apple of the Apple menu, and suspends the script execution. Activating HyperCard window stops blinking and restarts the script.
</text>
</content>
<name>Notification 1.0</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_35889.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
PrintPICT prints a PICT file, resource or the clipboard content with a prompt if desired.
SYNTAX
-------
PrintPICT <filename|"clipboard"|"*">[,<R=res name or ID>]
[,<page setup dialog>][,<print dialog>][<prompt>]
PARAMETERS
------------
<filename|"clipboard"|"*"> telles where the picture is coming from.
Being a filename, it can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
"clipboard" will print the clipboard content.
"*" stands for the current stack, when PICT resource printing is required.
<R=res name or ID> defines the PICT resource to print. It can be its name or ID. This param is ignored when first is "clipboard".
<page setup dialog> is a boolean allowing to have to page setup dialog to pop up. Default is FALSE.
<print dialog> is a boolean allowing to have to printing dialog to pop up. Default is FALSE.
<prompt> is a prompt string which will be printed at the bottom of page using Helvetica 12.
Using "!", "?" and "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
Without dialog, the XCMD uses the previous settings for printing.
Printing is centered in page.
ERRORS
-------
If an error occurs, PrintPICT can return :
"Error : Printing Error"
"Error : Found no PICT in clipBoard"
"Error : Resource not found"
"Error : Not a PICT file"
"Error : Out of memory"
"Error : Couldn't read PICT file"
"Error : Missing or empty parameter"
"Error : Couln't load Scrap"
"Error : Missing resource identifier"
"Error : Out of memory"
"Error : Printing aborted"
"Error : Not a file"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
HISTORY
--------
1.3 : 03/24/92
ΓÇó Pict resizing now keeps proportions
1.2 : 03/09/92
ΓÇó Pict resized to fit in the printed page
1.1 : 12/26/91
ΓÇó Fixed alias file bug under System 7.0.1
ΓÇó Printing is centered in page
ΓÇó Added prompt text printing
ΓÇó Added PICt resource and clipboard printing
1.0 10/28/91
ΓÇó First release
</text>
</content>
<content>
<layer>card</layer>
<id>26</id>
<text>
CPU
System
Processor
FPU
ColoQD
Keyboard</text>
</content>
<content>
<layer>card</layer>
<id>27</id>
<text>Macintosh IIx
6.4
MC68030
true
true
Apple Extended keyboard</text>
</content>
<content>
<layer>card</layer>
<id>28</id>
<text> Owner Group All
See Folder
See Files
Modify
</text>
</content>
<content>
<layer>card</layer>
<id>29</id>
<text>Error : Not an AppleShare Volume</text>
</content>
<name></name>
<script></script>
</card>
card_37598.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
Privileges returns the access privileges of a folder on an AppleShare volume.
SYNTAX
--------
Privileges(<folder path>)
PARAMETERS
------------
<folder path> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The string returned is an array of 3 lines of 3 boolean items. The arrangement of this array is exactly the same as the "Get Privileges" dialog of the Finder. True means authorized access.
Owner Group All
-------+------+------
See Folder X X X
See Files X X X
Modify X X X
If an error occurs, the XFCN will return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Missing or empty parameter"
HISTORY
--------
1.2 :
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "=" param for online help
This stack uses FolderName XFCN (© Eric CARLSON and Anup MURARKA)
</text>
</content>
<content>
<layer>card</layer>
<id>26</id>
<text>
CPU
System
Processor
FPU
ColoQD
Keyboard</text>
</content>
<content>
<layer>card</layer>
<id>27</id>
<text>Macintosh IIx
6.4
MC68030
true
true
Apple Extended keyboard</text>
</content>
<content>
<layer>card</layer>
<id>28</id>
<text> Owner Group All
See Folder
See Files
Modify
</text>
</content>
<content>
<layer>card</layer>
<id>29</id>
<text>true,false,true
true,false,true
true,false,false</text>
</content>
<name>Privileges 1.2</name>
<script>
on opencard
end opencard
on closeCard
hide cd fld 4
hide cd fld 5
end closeCard
</script>
</card>
card_38114.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
Brings the dialog to screen, displaying the message. If message is omitted or empty, the dialog's width will be set by default to 300 points. If no vertical position is passed, the dialog will be centered vertically on the card. Dialog is resized when Prompt 1 is called twice.
Prompt 2 , <message>
Sets a new message in the current dialog.
Prompt 3
Disposes the current dialog and clears it from the screen.
USING
If no error occured, the Result will be empty. Otherwise, it can contain :
"Error : Bad Mode Parameter"
"Error : Bad coordinate"
"Error : Bad Width"
"Error : Missing Parameter(s)"
"Error : Prompt doen't work properly with HC 2.0"
HISTORY
-------
2.5
ΓÇó Completely rewritten code
ΓÇó Better SuperCard compatibility
ΓÇó Added HC 2.0 warning
2.4
ΓÇó Added automatice resizing when Prompt 1 is called twice.
</text>
</content>
<content>
<layer>card</layer>
<id>3</id>
<text>This a message test</text>
</content>
<name>Prompt 2.5</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_38572.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
This XCMD is the same as Prompt. Promptoid is for HC 2.0, while Prompt is for HC 1.2.
If you already use Prompt in stacks to be converted in HC 2.0 format, just use the compatibility script below so that no script changes will be necessary while the calling convention has changed.
</span><span class="style3"> </span><span class="style7"> </span><span class="style3">Compatibility script has changed with Promptoid 1.2.</span><span class="style1">
RemoveFolder is a XCMD allowing to delete a whole folder, even if it is not empty.
SYNTAX
-------
RemoveFolder <folder path|name>
PARAMETERS
------------
<folder path|name> can be a single name or whole pathname. If just a single name is supplied, it is assumed to be in the same folder than the current stack.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
If the remove is successfull, the Result will be empty. If an error occurs, the Result can return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Missing or empty parameter(s)"
HISTORY
--------
1.1 :
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "=" param for online help
The stack uses LeafName XFCN (by Kevin CALHOUN) and FolderName XFCN
(by Eric CARLSON and Anup MURARKA).
</text>
</content>
<name>RemoveFolder 1.1</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_53715.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
ResText XFCN allows to get text from any resource.
SYNTAX
--------
ResText(<res type>,<res ID or name>[,<fileName>]
[,<stripCtrl>][,"DontResolveAlias"])
PARAMETERS
------------
<res type> is a four chars string, giving the resource type.
<res ID or name> can be the ID or the name of the resource.
<fileName> is optional, and the full pathname of the file to get the resource from. It can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack. If not provided, the current stack is used.
<stripCtrl> is a boolean allowing to filter control chars from the got text. Default is TRUE.
"dontResolveAlias" allows to deal with an alias file itself (System 7.0 only) rather than with the file pointed by it.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The XFCN returns the text read from the resource.
If an error occurs, ResText can return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Missing or empty parameter(s)"
"Error : Bad resource type"
"Error : Resource not found"
"Error : Out of memory"
HISTORY
--------
1.1 :
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "=" param for online help
</text>
</content>
<name>ResText 1.1</name>
<script>
on opencard
end opencard
on closeCard
HideAll
end closeCard
on HideAll
hide cd fld 2
put empty into cd fld 2
end HideAll
</script>
</card>
card_40670.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
Each time the XCMD is called, the clipboard's content is added to the choosen ScrapBook.
SYNTAX
-------
ClipToScrap [<ScrapBook file>]
PARAMETERS
------------
With no parameter passed, the command uses the standard ScrapBook in the boot disk's System Folder. If a single name is passed, it uses the ScrapBook file in the boot disk's System Folder. With a full pathname, the ScrapBook can be precisely localised on the volume.
USING
-----
In any case, if the ScrapBook file already exists, the clipboard's content is simply added to the end of it. Otherwise, the ScrapBook file is created and its content set to the first item.
If no error occured, the Result will be empty. Otherwise, it can contain :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Volume not found"
"Error : ScrapBook creation failed"
"Error : Folder not found"
"Error : ScrapBook already open"
"Error : Unknown #XX"
"Error : Couln't load Scrap"
"Error : Empty ClipBoard"
"Error : Couldn't find System folder"
"Error : Not a ScrapBook file"
"Error : ScrapBook file is full"
"Error : Adding ClipBoard to ScrapBook failed"
HISTORY
--------
1.9 : 12/25/91
ΓÇó Fixed alias file bug under System 7.0.1
1.8 : 12/04/91
ΓÇó Fixed new scrapBook file creation bug
1.7 : 08/04/91
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "=" param for online help
1.5 :
ΓÇó fixed bug arising on Mac Plus only
1.3 :
ΓÇó fixed Clipboard resources counting
ΓÇó changed error messages
1.2 :
ΓÇó complete rebuilt of code
1.1 :
ΓÇó handling any type of Clipboard content
ScrapToClip 1.9
by Frederic RINALDI
DESCRIPTION
------------
The command gets the choosen item from the designed ScrapBook file and places it in the clipboard.
<item number|*> is a positive integer giving the item's row to get in the ScrapBook, or "*" (designing the last item of Scrapbook).
If <ScrapBook file> is omitted, the command uses the standard ScrapBook in the boot disk's System Folder. If a single name is passed, it uses the ScrapBook file at the same hierarchical level as the current stack. With a full pathname, the ScrapBook can be precisely localised on the volume.
<remove> is a boolean, telling if the Scrapbook item must be removed or not after its transfer to the Clipboard. Default is false (item kept).
USING
-----
If no error occured, the Result will contains a comma-delimited list of the resource types transfered to the clipBoard. Otherwise, it can contain :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Couldn't find System folder"
"Error : Missing item number"
"Error : Item number must be ≥ 0"
"Error : Not a ScrapBook file"
"Error : No such item in ScrapBook"
"Error : Couln't clear Clipboard"
"Error : Couln't set Clipboard"
HISTORY
-------
1.2 : 12/25/91
ΓÇó Fixed alias file bug under System 7.0.1
1.7 : 08/04/91
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "=" param for online help
1.5 :
ΓÇó fixed bug arising on Mac Plus only
1.3 :
ΓÇó Added Scrapbook item removing
ΓÇó changed error messages
1.2 :
ΓÇó complete rebuilt of code
1.1 :
ΓÇó handling any type of Clipboard content
</text>
</content>
<name></name>
<script></script>
</card>
card_55177.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
answer "Send :" with "Cancel" or "Field" or "File"
if it is "File"
then
get FilePath("TEXT","PostScript file :")
if it is empty then exit mouseUp
SendPS it
else SendPS cd fld 4
end mouseUp
</script>
</part>
<part>
<id>26</id>
<type>field</type>
<visible> <false /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>98</left>
<top>87</top>
<right>408</right>
<bottom>222</bottom>
</rect>
<style>shadow</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<textHeight>16</textHeight>
<name></name>
<script>on mouseUp
hide cd fld 3
hide cd fld 2
end mouseUp</script>
</part>
<part>
<id>27</id>
<type>field</type>
<visible> <false /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>179</left>
<top>107</top>
<right>381</right>
<bottom>207</bottom>
</rect>
<style>transparent</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>10</textSize>
<textStyle>plain</textStyle>
<textHeight>16</textHeight>
<name></name>
<script>on mouseUp
hide cd fld 3
hide cd fld 2
end mouseUp</script>
</part>
<part>
<id>28</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>0</left>
<top>275</top>
<right>320</right>
<bottom>342</bottom>
</rect>
<style>scrolling</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>12</textHeight>
<name></name>
<script></script>
</part>
<part>
<id>32</id>
<type>field</type>
<visible> <true /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>0</left>
<top>258</top>
<right>320</right>
<bottom>276</bottom>
</rect>
<style>rectangle</style>
<autoSelect> <false /> </autoSelect>
<showLines> <false /> </showLines>
<wideMargins> <false /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Geneva</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<textHeight>16</textHeight>
<name></name>
<script></script>
</part>
<content>
<layer>card</layer>
<id>26</id>
<text>
CPU
System
Processor
FPU
ColoQD
Keyboard</text>
</content>
<content>
<layer>card</layer>
<id>27</id>
<text>Macintosh IIx
6.4
MC68030
true
true
Apple Extended keyboard</text>
</content>
<content>
<layer>card</layer>
<id>32</id>
<text>Sample</text>
</content>
<content>
<layer>card</layer>
<id>1</id>
<text>
SendPS 1.3
© G. Kruckewitt & F. Rinaldi
DESCRIPTION
------------
SendPS allows to send PostScript datas to a LaserWriter over AppleTalk.
SYNTAX
---------
SendPS <container or pathname> [,<page setup> [,<print dialog>]]
PARAMETERS
------------
<container or pathname> can be either any valid container of HyperTalk, or the full pathname of a Postscript file. In the second case, a single name assumes the file is in the same folder than the current stack.
<page setup> is a boolean allowing to get the page setup dialog. Default is FALSE.
<print dialog> is a boolean allowing to get the printing dialog. Default is FALSE.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
------
If an error occurs, the Result can contain :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Missing parameter"
"Error : Could't allocate file buffer"
"Error : Second param must be boolean"
"Error : Third param must be boolean"
"Error : Out of memory"
HISTORY
----------
1.0 : first release
1.1 : use of spooler is allowed
blank trailing page removed when using a spooler
suppression de la page blanche en cas d'utilisation de spooler
1.2 : size of datas to be send can exceed 32 kb.
1.3 : 08/04/91
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "=" param for online help
This stack uses FilePath XFCN (© 1898, 1990 Apple Computer, Inc.)
answer "Set ΓÇ£" & theFlag & "ΓÇ¥ to :" with "Cancel" or "False" or "True"
if it is "Cancel" then exit mouseUp
SetFileFlag TheFile,TheFlag,it
if The Result Γëá empty
then answer the Result
else answer TheFlag && "flag is now set to" && it
end mouseUp
</script>
</part>
<part>
<id>29</id>
<type>field</type>
<visible> <false /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <true /> </lockText>
<rect>
<left>165</left>
<top>24</top>
<right>337</right>
<bottom>289</bottom>
</rect>
<style>shadow</style>
<autoSelect> <false /> </autoSelect>
<showLines> <true /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>bold</textStyle>
<textHeight>11</textHeight>
<name></name>
<script>on mouseUp
hide cd fld 2
hide cd fld 3
end mouseUp</script>
</part>
<part>
<id>30</id>
<type>field</type>
<visible> <false /> </visible>
<dontWrap> <false /> </dontWrap>
<dontSearch> <false /> </dontSearch>
<sharedText> <false /> </sharedText>
<fixedLineHeight> <true /> </fixedLineHeight>
<autoTab> <false /> </autoTab>
<lockText> <false /> </lockText>
<rect>
<left>258</left>
<top>24</top>
<right>335</right>
<bottom>289</bottom>
</rect>
<style>transparent</style>
<autoSelect> <false /> </autoSelect>
<showLines> <true /> </showLines>
<wideMargins> <true /> </wideMargins>
<multipleLines> <false /> </multipleLines>
<reservedFamily> 0 </reservedFamily>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>left</textAlign>
<font>Geneva</font>
<textSize>9</textSize>
<textStyle>plain</textStyle>
<textHeight>11</textHeight>
<name></name>
<script>on mouseUp
hide cd fld 2
hide cd fld 3
end mouseUp</script>
</part>
<content>
<layer>card</layer>
<id>1</id>
<text>
SetFileFlag 1.1
by Frédéric RINALDI
DESCRIPTION
------------
SetFileFlag is an XCMD allowing to change the value of the authorized Finder flags of a file.
SYNTAX
-------
SetFileFlag <file path or name>,<flag name>[,<flag state>]
[,"DontResolveAlias"]
PARAMETERS
------------
<file path or name> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
<flag name> must be one of the following string values (accepted System 7.0 values are enclosed in brackets) :
SetFinderLock XCMD allows to lock/unlock a file (Finder info checkbox).
SYNTAX
--------
SetFinderLock <file path or name>[,<locked>][,"DontResolveAlias"]
PARAMETERS
------------
<file path or name> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack.
<locked> is a boolean defining the lock state. Default is TRUE.
"dontResolveAlias" allows to deal with an alias file itself (System 7.0 only) rather than with the file pointed by it.
Using "!", "?" and "=" as parameter will return an online help (resp. copyright, syntax and output).
USING
-----
If an error occurs, SetFinderLock can return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Missing or empty parameter"
"Error : Bad param #X"
HISTORY
--------
1.1 : 08/04/91
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "DontResolveAlias" parameter
ΓÇó Added "=" param for online help
This stack uses FilePath XFCN (© 1898, 1990 Apple Computer, Inc.)
</text>
</content>
<name>SetFinderLock 1.1</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_42655.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
answer "Video mode :" with "Cancel" or "Black" or "Color"
if it is "Cancel" then exit mouseUp
put it into Mode
ask "Video depth : (1.." & item 5 of SavedVideo & ")" with 1
if it is empty then exit mouseUp
put it into Depth
ask "Screen number : (nothing,*,1.." & number of lines of SavedVideo¬
& ")"
if it Γëá empty
then SetMode Mode,Depth,it
else SetMode Mode,Depth
if the Result Γëá empty
then answer the Result
end mouseUp
</script>
</part>
<content>
<layer>card</layer>
<id>1</id>
<text>
SetMode 1.2
by Frédéric RINALDI
IMPORTANT NOTICES
-------------------
ΓÇó SetMode works only with System >= 6.0.5
ΓÇó Since changing video mode is not recommended by Apple Interface Guideli-nes, always switch back to previous mode when leaving the stack. (see stack script)
DESCRIPTION
------------
SetMode XCMD allows to switch any connected screen from one video mode and depth to another.
First param stands for the mode. Only first char is recognized.
Param 2 is the video depth, an integer bit value.
Last param is optional, and is an integer standing for the screen number (as returned by GetMode XFCN). If omitted, the changed screen will be the screen on which the card is. Using "*" will change all connected screen to the choose mode.
Using "!" and "?" as parameter will return an online help (resp. copyright and syntax).
USING
-----
If an error occurs, SetMode can return :
"Error : Could'nt get SysEnvirons"
"Error : XCMD needs System 6.0.5"
"Error : Color QuickDraw not found"
"Error : Missing parameter(s)"
"Error : Mode param must be <B|C>"
"Error : Depth not available on device X"
"Error : Couldn't set depth on device X"
"Error : Device not found"
RELEASES HISTORY
------------------
1.2 :
ΓÇó Fixed last minute bug
1.1 :
ΓÇó Screen garbage fixed when switching to 8bit, thanks to Bill Steinberg.
This stack also uses GetMode XFCN, © Frederic RINALDI.
</text>
</content>
<name>SetMode 1.2</name>
<script>
on opencard
global SavedVideo
-- sauvegarde du mode vidéo courant
put GetMode() into SavedVideo
end opencard
on closeCard
global SavedVideo
-- restauration du mode vidéo initial
get GetMode()
repeat with i=1 to number of lines of SavedVideo
if line i of it Γëá line i of SavedVideo
then do "SetMode" && line i of SavedVideo
end repeat
end closeCard
</script>
</card>
card_43137.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
ShowHideFolder allows make a folder visible/invisible.
SYNTAX
--------
ShowHideFolder <folder path>,<invisible>
PARAMETERS
------------
<folder path> is the folder complete pathName, with or without trailing colon. If only a name is supplied, the folder is considered in the same folder as the current stack.
<invisible> is a boolean, TRUE making the folder invisible.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
If an error occurs, ShowHideFolder can return :
"Error : Not a file"
"Error : Not a folder"
"Error : Alias file not supported"
"Error : Volume not found"
"Error : Bad Name"
"Error : File not found"
"Error : Folder not found"
"Error : File is busy"
"Error : I/O Error"
"Error : Folder is full"
"Error : Volume is locked"
"Error : No resource fork"
"Error : Duplicate file/folder name"
"Error : Moving whole volume not allowed"
"Error : Not an AppleShare volume"
"Error : AppleShare insufficient privileges"
"Error : Missing or empty parameter(s)"
"Error : Second param must be boolean"
HISTORY
--------
1.1 : 08/04/91
ΓÇó Added support for System 7.0 alias files
ΓÇó General enhancement of the code
ΓÇó Added "=" param for online help
</text>
</content>
<name>ShowHideFolder 1.1</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_43746.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<res name> is the name of the "snd " resource to be created.
<quality> is the recording quality. it can be "good", "better" or "best". Default is "better".
<dest file> can be a single name or whole pathname. If just a single name is supplied, the file is assumed to be in the same folder than the current stack. Aliases are also supported. Default is current stack.
<"AddStar"> allows to force creation of fake STAR resource for SuperCard projects, even with non standard file creator.
Using "!", "?" and "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
Calling the XCMD brings the standard recording dialog, and requires System 6.0.5 or higher.
Any previous "snd " resource with same name is simply replaced by the new recorded one.
Using HyperCard 2.x, sound will be saved as Type 1 snd resource, while it will be saved as Type 2 snd using HyperCard 1.x or SuperCard.
ERRORS
-------
If an error occurs, SoundRecord can return :
"Error : Too old Sound Manager version"
"Error : Cannot record sound with this System version"
"Error : Input device not available"
"Error : Missing or empty parameter"
"Error : Bad recording quality parameter"
"Error : Invalid sound input device"
"Error : Sound input device unavailable"
"Error : Couldn't create "snd " resource"
"Error : Couldn't create "snd " STAR resource"
"Error : unknown #xx"
HISTORY
--------
1.4 11/08/91
ΓÇó Added "AddStar" param
1.3 10/15/91
ΓÇó Sound always recorded as fake data resource in SC files
1.2 10/11/91
ΓÇó Sound recorded as real resource in non-current standalone SC projects
1.1 10/10/91
ΓÇó Added <dest file> param
ΓÇó Created 'snd ' resource IDs are never in 0..8191 (Apple reserved slots)
ΓÇó Enhanced Type1 -> Type2 snd conversion
ΓÇó Fixed HC2 environment test
1.0 10/04/91
• First release
</text>
</content>
<name>SoundRecord 1.4</name>
<script>
on opencard
end opencard
on closeCard
end closeCard
</script>
</card>
card_51907.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
Only first param is needed. Order of params 3 to 7 doesn't matter, since the XCMD is able to recognize them.
WName is a string giving the windoid name. Many windoids can be opened by using different names.
List is a comma/return delimited string that will be displayed. Line separator is return, column is comma.
WStyle is a string defining the window style. Allowed styles are : plain, zoom, roundRect, rect, shadow, windoid, windoidZoom, bigWindoid, bigWindoidZoom, Rinaldoid, RinaldoidZoom (Rinaldoid is the same as windoid, except that it displays the window title). All window styles are floating, except plain, zoom and roundRect. A windoid or Rinaldoid style window will have small scrollbars, while other styles will use standard size. Default is RinaldoidZoom if Rinaldoid WDEF resource is present, windoidZoom if not found.
<X,Y[,Z,T]> will be a point or a rect, and will define position and/or size of the windoid. Coordinated are card-relative. If omitted, windoid will appear with standard size at "0,10".
<NO|ONE|CON|DIS> defines the selection mode (no selection, one at a time, may but adjacent, many disjoint). Default is ONE.
<cell(s)> comma separated list of cell coordinates. Each cell coordinate is a string of two integers separated by space, giving line and column number of the cell ("<line>_<column>[...,<line>_<column>]"). It defines the selected cells(s) when the windoid appears.
Default is "1 1", but "0 0" can be used to have no selection at start.
<textFont[,textSize]> is the name of font and its size to use. Default is Geneva 10.
<textAlign> is the text alignment in the cells (left, center, right). Default is "left".
<frame> is a boolean telling if the cells must be framed or not. Default is true, but frame appears only if Tabloid LDEF is present in resource fork.
Using "!" and "?" as parameter will return an online help (resp. copyright and syntax).
Tabloid is stand alone, no linked resource is needed. Meanwhile, this stack contains a LDEF, WDEF and CDEF resources that are recognized by the XCMD if present.
The LDEF allows to have framed cells like in a spreadsheet, vertical centering of text in cells and text alignmenet. The WDEF allows to have an enhanced windoid-type window displaying title, while the CDEF is useful to get nice-looking scroll arrows for small scroll bars. So, these resources are optional, and for aesthetic purpose only. If you copy them, their ID can be set to any value but don't change their name.
If you use a rect ot shadow style window, placing it on a card can simulate a smart HyperCard spreadsheet field.
If no rectangle param is used, the size of the window will be set according to maximum number of lines and columns contained in the list. The cells have all the same size which is automatically calculated according to the longest contained string.
Clicking on cells(s) in the windoid sends a "TabloidSelect" message followed by the clicked word(s) and the Tabloid name. This message can be trapped using a handler :
</span><span class="style5"> on TabloidSelect What,Where
in order to avoid HyperCard's confusion, existing quotes in What param are automatically changed to single quote.
When a windoid is opened, the "openTabloid" message is sent, followed by the windoid name. This allows to define window properties before it is shown, since the message can be trapped using a handler :
</span><span class="style5"> on openTabloid Which
if Which is "MyWindow" then...
end openTabloid
</span><span class="style1">
When a windoid is close, the "closeTabloid" message is sent, followed by the windoid name. This message can be trapped using a handler :
</span><span class="style5"> on closeTabloid Which
the card script contains a "on ControlKey" handler that allows selection of first matching cell when typing a key in conjunction with control key. Moreover, while holding the control key down, the arrow keys allow to move in the list, return or enter to simulate a double-clic.
It is possible to send any string to search for to the window using :
</span><span class="style5">send "string" to window <WName></span><span class="style1">
If the string is found, it will be highlighted int the window. Look for "on controlKey" handler in the card script, type Control+Key to try it.
The lockText property define the behaviour of the window. Default value is TRUE, meaning that a click on a cell selects it. When cursor is over window, holding Option key (or having lockText set to FALSE) allows to change cell size by dragging or edit their content. The cursor's shape tells exactly what can be done.
One in editing mode, cell is framed and moving around is possible using Tab or Return key with or without Shift key (validation). To exit editing, type Enter (validation) or Escape key (cancelling), or click in any other cell.
Setting properties involving cell size also resizes the window to keep previously visible cell still visible.
Only first param is needed. Order of params 3 to 10 doesn't matter, since the XCMD is able to recognize them.
</span><span class="style3">WName</span><span class="style1"> is a string giving the windoid name. Many windoids can be opened by using different names.
</span><span class="style3">Text</span><span class="style1"> is the text that will be displayed in the windoid. It can be litteral or a field descriptor.
</span><span class="style5">Textoid "Test","This is my text"</span><span class="style1">
If you pass a valid field descriptor enclosed in quotes, HyperCard will not interpret it and Textoid will use the full-styled text of that field rather than its text only. If the descriptor is not valid, Textoid will use it as litteral.
</span><span class="style3">WStyle</span><span class="style1"> is a string defining the window style. Allowed styles are : plain, zoom, roundRect, rect, shadow, windoid, windoidZoom, bigWindoid, bigWindoidZoom, Rinaldoid, RinaldoidZoom (Rinaldoid is the same as windoid, except that it displays the window title). All window styles are floating, except plain, zoom and roundRect. A windoid or Rinaldoid style window will have small scrollbars, while other styles will use standard size. Default is RinaldoidZoom if Rinaldoid WDEF resource is present, windoidZoom if not found.
</span><span class="style3">Color</span><span class="style1"> is a one or two items string giving the foreground and background color. For each item, allowed values are the standard colors (black, white, blue, red, yellow, cyan, magenta, green), or a three word string corresponding to red, green and blue values (100 5624 28652).
</span><span class="style3"><X,Y[,Z,T]></span><span class="style1"> will be a point or a rect, and will define position and/or size of the windoid. Coordinated are card-relative. If omitted, windoid will appear with standard size at "0,10".
</span><span class="style3">textWrap</span><span class="style1"> is a boolean to wrap (true) or not (false) the text in the windoid. This param makes also the horizontal scrollBar be invisible (true) or visible (false). Default is true, and horizontal scroll being hidden.
</span><span class="style3">FName</span><span class="style1"> is a string giving the font that will be used. Default is Geneva.
</span><span class="style3">FSize</span><span class="style1"> is a string giving the font size that will be used. Default is 9.
</span><span class="style3">FStyle</span><span class="style1"> is an item(s) string giving the font style(s) that will be used (plain, bold, italic, outline, underline, shadow, condense, extend, grouped). Default is Plain.
</span><span class="style3">FAlign</span><span class="style1"> is a string giving the text alignment that will be used (left,right, center). Default is left.
Using "!", "?" or "=" as first parameter will return an online help (resp. copyright, syntax and output).
Textoid is stand alone, no linked resource is needed. Meanwhile, this stack contains a WDEF and a CDEF resource that are recognized by the XCMD if present. The WDEF allows to have an enhanced windoid-type window displaying title, while the CDEF is useful to get nice-looking scroll arrows for small scroll bars. So, these resources are optional, and for aesthetic purpose only. If you copy them, their ID can be set to any value but don't change their name. Each window can contain up to 32000 chars.
If you use a rect or shadow style window, placing it on a card can simulate a smart double-scroll HyperCard field.
With multiple screens configuration, the windoid will be zoomed on the screen that it lays on.
Textoid offers full text editing with Cut, Copy, Paste and Erase. </span><span class="style2">lockText </span><span class="style1">property allows to lock/unlock the content. When a window is created, its text is locked. Like for a field, the content must be locked to accept mouseDown events (thus HyperText). If unlocked, the insertion point will be set at the clickLoc.
ΓÇó Control-Clic in text allows to move the window
ΓÇó Command-Click in text locks/unlocks the text (only if </span><span class="style2">UnLockAllowed</span><span class="style1">
property is true).
ΓÇó Option-Clic in text allows to move text with grabber hand
ΓÇó Holding ShiftKey makes any scrolling smoother.
ΓÇó Holding OptionKey while clicking in a scrollBar reverses the scroll
ΓÇó Command-A selects the whole text (if unlocked)
ΓÇó Control-Option-P, B, I, U, O, S, C, E, G changes selection style
</span><span class="style2">SelectedChunk</span><span class="style1"> property allows to select any part of the text. When using </span><span class="style5">set selectedChunk of window "MyWindow" to "X,Y"</span><span class="style1">, the window is brought to the front, the text is automatically unlocked, scrolled to show the insertion point, and you are ready to type in it. You can also get the selectedChunk when the window is closed using :
</span><span class="style5"> on closeTextoid Which
get selectedChunk of window Which
put char (item 1 of it) to (item 2 of it) of Text¬
of window Which
end closeTextoid
</span><span class="style1"> In order to allow text manipulation by clicking on an HC button, Textoid keep the last selection in a global variable </span><span class="style2">TextoidLastSelection</span><span class="style1"> :
the insertion point will be placed at the end of the text by using :
</span><span class="style5">set selectedChunk of window MyWindow to 32000</span><span class="style1">
When a Textoid is displayed, font, style, size and even color are accessible using the existing menus. These act exactly like for HyperCard fields : if there is no current selection in the windoid, menus change the global window attributes. Otherwise, only the current selection attributes are changed.
</span><span class="style2">FieldTransfer</span><span class="style1"> property (</span><span class="style3">set</span><span class="style1"> only) allows to transfer the full-styled text from the windoid to any existing field. Field descriptor must be enclosed in quotes, like the input parameter.
</span><span class="style5">set fieldTransfer of window "Test" to "cd fld 1"
</span><span class="style1"> Both scrollBars can now be hidden. In this case, the growBox remains hidden, but is stilll active.
</span><span class="style5"> on openTextoid WName,WId
if WName is "MyWindow"
then
set textWrap of window WName to true
set ShowVScroll of window WName to false
end if
end openTextoid
</span><span class="style1"> The window content can now be printed by using :
</span><span class="style5"> send "print" to window "MyWindow"
</span><span class="style1">
</span><span class="style5">
</span><span class="style4">MESSAGES
</span><span class="style1">
</span><span class="style3">OpenTextoid</span><span class="style1"> : sent when a windoid is opened, followed by the windoid name and ID. This allows to define window properties before it is shown, since the message can be trapped using a handler :
</span><span class="style5"> on openTextoid WName,WId
if WName is "MyWindow" then...
end openTextoid
</span><span class="style1"> </span><span class="style3">CloseTextoid</span><span class="style1"> : sent when a windoid is closed, followed by the windoid name and ID. This allows to define window properties before it is shown, since the message can be trapped using a handler :
</span><span class="style5"> on closeTextoid WName,WId
if WName is "MyWindow" then...
end closeTextoid
</span><span class="style1"> </span><span class="style3">ActivateTextoid</span><span class="style1"> : sent for non-floating windows only (plain, zoom, roundRect), when the window is activated. It is followed by the windoid name and ID.
</span><span class="style3">
</span><span class="style1"> </span><span class="style3">DeActivateTextoid</span><span class="style1"> : sent for non-floating windows only (plain, zoom, roundRect), when the window is de-activated. It is followed by the windoid name and ID.
</span><span class="style3">
</span><span class="style1"> </span><span class="style3">ClickInText</span><span class="style1"> : </span><span class="style5">s</span><span class="style1">ent when clicking on a word in the locked window, followed by the clicked word, windoid name and ID, start and end char being clicked, font, size, style and color of text.
If the whole sent string (message + params) exceeds 255 chars, then the string will consist of its first 254 chars, followed by character "..." to signify the overflow (the ellipsis character, not three dot characters, hex C9).
</span><span class="style3">Note</span><span class="style1"> : Fnt, Size, Stl et Col may contain many items if the clicked text has different text attributes.
Like any XWindow, Textoid has properties that can be get and set thru HyperTalk. Default values are shown </span><span class="style14">underlined</span><span class="style1">.
</span><span class="style5">properties of window "Textoid"</span><span class="style1"> will return an item list of all allowed properties :
ΓÇó loc : windoid's position according to card (X,Y)
ΓÇó globalLoc : windoid's position according to screen (X,Y)
ΓÇó visible : windoid's visibility (</span><span class="style14">true</span><span class="style1"> or false)
ΓÇó id : windoid's id (</span><span class="style3">get</span><span class="style1"> only)
ΓÇó messages : list of messages sent by the windoid
ΓÇó text : windoid's text (quoted field descriptor gives full style)
ΓÇó rect : windoid's position and size according to card (X,Y,Z,T)
ΓÇó globalRect : windoid's position and size according to screen (X,Y,Z,T)
• textFont : current selection's or windoid's font (</span><span class="style14">geneva</span><span class="style1">, times, …)
• textSize : current selection's or windoid's font size (</span><span class="style14">9</span><span class="style1">, 10,…)
ΓÇó textAlign : windoid's text alignment (</span><span class="style14">left</span><span class="style1">,right,center)
ΓÇó textStyle : current selection's or windoid's text style (</span><span class="style14">plain</span><span class="style1">,italic,
ΓÇó zoom : zoomed state (</span><span class="style14">in</span><span class="style1">, out)
ΓÇó textColor : current selection or windoid's text color (</span><span class="style14">black</span><span class="style1">, white,
blue, red, yellow, cyan, magenta, green) or (R G B)
ΓÇó backColor : back color (black, </span><span class="style14">white</span><span class="style1">, blue, red, yellow, cyan, magenta,
green) or (R G B)
ΓÇó lockText : text locking (</span><span class="style14">true</span><span class="style1"> or false)
ΓÇó viewChunk : visible text portion (Start[,Stop])
ΓÇó selectedChunk : current selection offset (Start,Stop)
ΓÇó selectedText : current selection text (</span><span class="style3">set</span><span class="style1"> allows to replace selected
text in the window by another text)
ΓÇó fieldTransfer : text transfer to any field</span><span class="style3"> </span><span class="style1">(</span><span class="style3">set</span><span class="style1"> only)
ΓÇó textWrap : wrapping of text (</span><span class="style14">true</span><span class="style1"> or false)
ΓÇó textWidth : width of text</span><span class="style3"> </span><span class="style1">(</span><span class="style3">set </span><span class="style1">has no effect if </span><span class="style2">textWrap</span><span class="style1"> = true)
ΓÇó UnLockAllowed : unlocking text by Cmd-click permission (</span><span class="style14">true</span><span class="style1"> or false)
<H[andlers]|V[ariables]|X[ternals]> defines the desired X-Ref mode: by handlers, by variables or by externals.
<ListAll> is a boolean. When TRUE, all subitems are listed for each found entry. Default is FALSE.
<ListNb> is a boolean, used only if <ListAll> = TRUE. When TRUE, all line numbers are listed along with each subitem. Default is FALSE.
Using "!", "?" and "=" as first parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The XFCN returns a list of found entries, depending of the choosen X-Ref mode. Each entry is followed by its type, which can be [HN] (handler), [LV] (local variable, [GV] (global variable), [XC] (external command) or [XF] (external function).